The second state of the race began in sweltering conditions in the inner-city Adelaide suburb

Australian sprinter Caleb Ewan surged past world champion Peter Sagan to win the second stage of the Tour Down Under and claim the ochre leader's jersey in the Adelaide Hills town of Stirling on Wednesday. 

In a thrilling finish on the uphill climb into Stirling, Ewan clung to Sagan's wheel and pulled out with 100 metres to go, finishing too strongly for the Slovakian, who came in fourth behind Ewan, Daryl Impey and Jay McCarthy at the season-opening event. 

Ewan's BMC Racing team brought a strong squad to the Tour Down Under with the aim of securing overall victory for Ewan's fellow countryman Richie Porte. 

But Ewan's 10-second time bonus puts him into the leader's jersey, replacing German Andre Greipel, who was dropped from the peloton when the climb began, six kilometres from the finish line. 

"It was a super tough finish and it was one that we were all so unsure about whether we'd make it over the top," Ewan said. 

"But the boys put me in a perfect position again and they backed me 100 percent even after some results that we weren't hoping for. 

"So for them to back me on a stage that probably doesn't even suit me, it means a lot." 

Wednesday's race began in sweltering conditions in the inner-city Adelaide suburb of Unley and wound its way through the Adelaide Hills in temperatures reaching as high as 38 Celsius (100 Fahrenheit). 

A group of four riders immediately broke away including the three who led Tuesday's break, Australian pair William Clarke (EF Education First-Drapac) and Scott Bowden (UniSA) and South African Nicholas Dlamini (Team Dimension Data). They were joined by Spaniard Jaime Castrillo (Movistar) and quickly opened a four minute lead over the peloton. 

Dlamini dropped back when he claimed the King of the Mountain points after just 22 kilometres (13.6 miles). 

But the remaining three stayed away until Clarke and Bowden dropped back after Clarke had picked up the bonus seconds for the two intermediate sprints, leaving Castrillo to make a long 70 kilometre run for home. 

The peloton began to make its move with 40 kilometres to go and the Spaniard was eventually caught 13.5 kilometres from the finish. 

The peloton split as the pace increased and Sagan surged clear, but the Slovakian couldn't hold off Ewan, who claimed his seventh Tour Down Under stage win. 

The third stage is a 146.5 kilometre run from the beachside suburb of Glenelg to the town of Victor Harbor on the Fleurieu Peninsul