Sagan, riding for the Bora-Hansgrohe team, beat Bahrain-Merida’s Sonny Colbrelli on the line, with Groupama-FDJ’s Arnaud Demare in third place.
The world champion leapfrogged Fernando Gaviria of Quick-Step Floors in the general classification standings by winning the stage.
Direct Energie’s Sylvain Chavanel made an early move and opened up a small gap before Wanty-Groupe Gobert’s Dion Smith and Trek-Segafredo’s Michael Gogl joined him at the front.
The Quick-Step Floors team were, at that point, willing to let the trio go.
The break began to take shape when the leaders went 40 seconds ahead after just 5km. They later extended the gap to 90 seconds, with Quick-Step Floors having controlled the head of the peloton.
Almost 25 km into the race, the gap was almost three minutes. Ten kilometres farther, Gogl fell away when he had to receive medical attention for a knee problem.
Several kilometres later, Chavanel soloed ahead and created a four-minute lead at the 66km-mark, while Quick-Step continued to control the peloton.
With 100km remaining, Chavanel went four-and-a-half minutes clear from the peloton.
South African Reinardt Janse van Rensburg, riding for Dimension Data, suffered a mechanical setback with about 80km remaining.
Chavanel’s lead dropped to under three minutes with 73km remaining as he battled to hang on but 10km farther it was back to four minutes. The Frenchman took maximum points at the intermediate sprint, but the peloton began closing the gap.
Sagan was second in the intermediate sprint and Gaviria third.
With 37 km to go, the peloton had closed the gap to 100 seconds as the DiData and Bora-Hansgrohe riders moved toward the front to prepare for the final section of the stage.
Chavanel’s lead dwindled over the next 10km but the tiring rider picked up a 3-second bonus in the sprint 14km from the finish.
The peloton quickly closed in as the pace picked up, with the general classification contenders vying for places near the front.
Chavanel’s 170km effort was no avail as he was hauled in. Six kilometres from the line, Groupama-FDJ, Bora-Hansgrohe and Team Sky were all out in numbers near the front.
The peloton stretched before South African Daryl Impey and the man in the yellow jersey, Fernando Gaviria, were involved in a crash less than 2 km from the end.
Bora-Hansgrohe executed a fine lead-out in the closing section and Sagan passed Demare late in the sprint to take the spoils on the line.
Sagan thanked his teammates, saying “We were in front the whole last 30km. I expected something easier but it was really tough; up and down, with many climbs and descents.”
Luke Durbridge crashed out but was not injured.