Simon Gerrans just holds of Peter Sagan at the line to win hilly 3rd stage of Tour de France

Australian sprinter Simon Gerrans held off a late charge by Peter Sagan to win Monday's hilly third stage of the Tour de France by less than half a wheel, while unheralded Belgian rider Jan Bakelants did enough in the sweltering heat to keep the race leader's yellow jersey.

Gerrans looked to have the finish line in sight with about 100 metres to go, though the Slovakian rider launched a devastating late sprint and almost caught him. But Gerrans dug deep to clinch his second career Tour stage win. Spaniard Jose Joaquin Rojas finished third.

"To beat a guy like Sagan in a sprint like that, I'm very happy," the 33-year-old Gerrans said. "It went perfectly for me."

Gerrans was slowing up but just managed one last effort to throw his bike forward the way a 100-meter runner would dip for the line.

"I wasn't sure if I had won — a half-wheel length?!" Gerrans said. "All went perfectly well, my team took great care of me after the last climb."

He will especially need to thank his countryman and teammate Simon Clarke, who placed himself in the early breakaway.

"It was the team plan. I was brought to the Tour de France to join breakaways, so I made sure I did my job," Clarke said. "I was quite relaxed today and when you're relaxed it means you have good legs."

It was a particularly welcome win for Gerrans' Orica Greenedge team after the confusion of Saturday's first stage, when the team grabbed the attention of the world's media when its bus was stuck on the finish line and could only be removed moments before the riders arrived.

"We saw the footage," Gerrans said. "You really can't do (anything) but laugh at the situation. (Our driver) did a fantastic job, we are proud of him."

Sagan is in the coveted sprinter's green jersey he is expected to contest with British sprinter Mark Cavendish.

"I'm a bit sad about the stage, but the team's objective is to get the green jersey and that's what we have," Sagan said through a translator. "I fell in the first stage and I don't feel at my best yet. But the Tour is long and there are still a lot of good stages to come."

Bakelants, the winner of Sunday's second stage, finished in 19th place.

"The team worked very hard for me, and I'm very happy to keep the yellow jersey," Bakelants said. "It was a very hot day and the conditions were not easy."

Monday's 145.5-kilometre (90-mile) trek started from Ajaccio, where French emperor and military mastermind Napoleon Bonaparte was born in 1769, and finished in Calvi after three moderate climbs and a steeper last climb tested the legs of the peloton.

Gerrans clocked a winning time of 3 hours, 41 minutes, 24 seconds.

It was the last of the trio of Corsican stages before the race heads back to mainland France for Tuesday's team time trial in Nice.

A five-man breakaway consisting of Frenchmen Cyril Gautier, Alexis Vuillermoz, Sebastien Minard, Clarke and Dutchman Lieuwe Westra was gradually pegged back as the stage snaked through the Corsican hills.

Nearing the halfway point, riders cut through the sleepy village of Piana, and then sped down the razor-thin roads along canyons overlooking the simmering blue waters of the Mediterranean below.

With the Tour heading through Corsica for the first time, some fans got their first glimpse of the showcase race — and made a point of getting noticed themselves. One defied the sweltering heat to dress up in a full Napoleon outfit, saluting from the roadside.

Further on, a man held up a Coriscan flag as he rode on horseback alongside the rolling pack.

"The scenery was great, but for us it was super stressful," veteran French rider Sylvain Chavanel said.

Clarke was the last of the breakaway group to be caught on the final climb — the day's hardest, a 3.3-kilometre (2-mile) ascent up Col de Marsolino with a sharp gradient of 8.1 per cent.

Frenchman Pierre Rolland dominated the climb and was about 10 seconds clear when he went over the top. But he was caught on the descent by Chavanel, Norwegian Lars-Peter Nordhaug and Spaniard Mikel Nieve.

"It's hard to hold on when you're on your own," said Rolland, who kept hold of the polka-dot best climbers' jersey.

The main pack soon swallowed them up, and the sprinters came into position to contest the stage win.

Sagan attacked first, but then dropped off as Gerrans sped past him.

If Gerrans thought the win was sealed, he was wrong, as Sagan roared back on the outside and almost did enough.