Earlier in the day, Greg Van Avermaet (BMC) had sprinted for intermediate bonus seconds to slightly extend his lead in the general classification.
The short climb inside the final kilometre tempted a number of the classics specialists to the fore, including BMC's Greg Van Avermaet in the yellow jersey, but once the road levelled off it was Sagan who still had the most power left in his legs. I didn't think it was going to happen, but the legs just were there.
Sagan said following the yellow jersey had helped land him the stage.
After winning such a prestigious stage to conclude last year's Tour, Groenewegen struggled to make an impact in the early days of this race, a fourth-place finish in Stage 4 his best effort until this victory, which he feels will kickstart his race. He entered the stage seventh overall and finished it 15th and one second behind Froome.
But Bardet was able to pace his way back alongside Landa and the duo lost just seven seconds to Froome's group.
"But today, I was very lucky, too, because Colbrelli was quickly coming close to me", the Slovak said in his first post-victory interview for the Eurosport channel.
Since the route was announced in October, this 156.5km stage nine over the cobbles of northern France to Roubaix had been circled as the wildcard which could deliver a jolt to the race, and it did not disappoint.
"I just keep trying, our backs are against the wall all the time here", said the 33-year-old, who is in a contract year but is expected to stay with Dimension Data.
"Third is okay, if I win what do I get except an extra point or two?"
"(Porte) can be confident after this climb", Van Avermaet said.
Dan Martin celebrates as he crosses the line to take yesterday's sixth stage of the Tour De France.
Sometimes in cycling the bike can be the rider's biggest enemy.
Friday will see the riders take on the longest stage of the race at 218km when they take off from Fougeres and finish in Chartres. It's a true transitional stage, mostly aimed at getting the peloton from point A to point B. Starting in Fougères, the terrain is generally flat to rolling, with a long downhill finish in Chartres that should give the sprinters' teams enough time to reel in the day's long breakaway.