Mark Cavendish claimed his 24th Tour de France stage victory on the seafront in Marseille as he shrugged off the last remnants of bronchitis.

The Manxman triumphed in a bunch sprint finish ahead of Team Sky's Edvald Boasson Hagen, with Cannondale's Peter Sagan beating Andre Greipel of Lotto-Belisol to third.

A major crash 200 metres from the finish stopped much of the peloton in its tracks, but Cavendish was already flying over the line.

Simon Gerrans of Orica-GreenEdge retains the race leader's yellow jersey.

Ireland's Nicolas Roche finished 25th on the stage, and remains ninth overall, nine seconds off the lead. Fellow Irish rider Dan Martin finished 104th and lies 17th overall.

It was a much-needed win for Cavendish, who had been affected by an illness he did his best to conceal in the opening days of the Tour, keeping quiet in the hope he could get over it before any of his rivals realised he was suffering.

They probably got the idea from the way he was dropped in the Corsican mountains, but he looked back to his imperious best as he took advantage of a brilliant lead-out from his Omega Pharma-Quick Step team-mates.

The peloton had chased down the last remnants of an early breakaway inside the final five kilometres, and Cavendish's team held the line past the Statue de David and through the last of the record 55 roundabouts on this Tour stage.

This is his 24th stage victory in the Tour, and leaves him one shy of Andre Leducq's 25 for third all-time in the event's history.

There was no change at the top of the general classification, with Gerrans retaining yellow while his team-mates Daryl Impey and Michael Albasini are on the same time, with Michal Kwiatkowski and Sylvain Chavanel of Omega Pharma-Quick Step fourth and fifth.

Sagan's second place keeps him in the green jersey.

The late crash had no affect on the general classification standings with riders all awarded the same time as it came so close to the finish.

The 228.5km run from Cagnes-sur-Mer to Marseille was the second longest stage of this year's Tour, topped only by next week's 242.5km run to Mont Ventoux on Bastille Day.

Orica GreenEdge, defending the maillot jaune of Gerrans, began it decked out in yellow helmets as the team classification leaders after their back-to-back stage victories - the Australian squad stealing almost all the early headlines of this Tour given the starring role of their bus in the opening day chaos.

While they set the pace at the front of the peloton, an early breakaway composed of Europcar's Yukiya Arashiro and Kevin Reza, Euskaltel-Euskadi's Romain Sicard, Thomas De Gendt of Vaconsoleil, Anthony Delaplace of Sojasun and Astana rider Alexey Lutsenko went up the road.

They quickly built a lead of more than 11 and a half minutes 20 kilometres in, making Japanese rider Arashiro the virtual race leader at that point.

De Gendt was pushing the pace, leading them over three of the four categorised climbs on the day and also winning the intermediate sprint - with Arashiro cresting the third categorised climb first.

When the peloton approached the intermediate sprint, Cavendish and Sagan almost collided as they scrapped over the remaining points, but it was Greipel who crossed the line seventh ahead of Katusha's Alexander Kristoff, with Sagan pipping Cavendish to ninth place.

Sagan then dropped back to the Cannondale team car for running repairs to his shoe, a mechanic leaning out of the side of the vehicle to take a screwdriver to the offending footwear as Sagan continued to ride.

By the time the peloton passed through Brignoles, the scene of a Cavendish stage win in 2009, the breakaway's lead had dropped back to around eight minutes. Richie Porte, Chris Froome's chief lieutenant in a Team Sky squad celebrating the third anniversary of their Tour debut, then suffered a puncture and had to have a quick wheel change before rejoining the bunch.

Further back, Geraint Thomas, who has been riding since the opening stage with a cracked pelvis, then also punctured requiring another painful standing start from the Welshman after a wheel change.

With a little more than 50km to go the front group began to splinter as Arashiro, De Gendt and Lutsenko peeled off the front, with Reza then bridging the gap to catch back up, leaving the others behind.

The gap to the peloton was plummeting, dropping under five minutes with 40km remaining.

As Sicard and Delaplace were swallowed up by the peloton with a little over 30km left, the gap to the front was down to three and a half minutes and Arashiro's spell as the virtual leader was over - he had started the day trailing Gerrans by three minutes 42 seconds.

The gap had fallen under two minutes inside the final 20km as Arashiro tried to push the pace at the front, and the peloton was then split by a big crash that saw several riders hit the deck, with stage one winner Marcel Kittel and King of the Mountains leader Pierre Rolland among those caught up.

The crash did not prevent the peloton from catching the last remnants of the breakaway - despite the best efforts of Reza and Lutsenko - just after the 5km board to set up the bunch sprint finish.

The field was reduced to 195 before the start, with Cannondale rider Ted King eliminated after he failed to finish yesterday's team time trial within the required time, the American missing out by just seven seconds as he dealt with injuries suffered on the opening stage.