Caleb Ewan, centre, narrowly triumphed in a sprint on stage seven ©Getty Images

Australia’s Caleb Ewan earned his maiden Giro d’Italia stage victory after edging a three-way sprint to the line in Alberobello.

The 224 kilometre stage seven, which began in Castrovillari, was the second longest route of the centenary edition of the race.

A two-man breakaway of Italy’s Giuseppe Fonzi and Russia’s Dimitri Kozonchuk formed in the early kilometres of the stage, with the pair being allowed to establish a lead by the peloton.

The duo, representing wildcard teams Wilier Trestina and Gazprom-Rusvelo, were able to enjoy most of the day at the front of the race.

They were comfortably caught by the peloton as teams began preparing for a sprint finish, with Orica-Scott aiming to set Ewan up for success.

The Australian was first to launch his sprint, but was forced to contend with the fast finishing Fernando Gaviria of Colombia and Ireland’s Sam Bennett.

But Ewan was able to claim the victory on a photo finish, narrowly edging out his rivals to win in a time of 5 hours, 35min and 18sec.

“It feels so good after the first few disappointments I've had,” said Ewan.

“I don't think I've felt so good before.

“It was a bit crazy at the end.

“We got caught too far back at about three kilometres to go, but we found each other.

“We didn't panic, the boys did a perfect job.”

The stage was the second longest of the centenary edition of the Giro d'Italia ©Getty Images
The stage was the second longest of the centenary edition of the Giro d'Italia ©Getty Images

The top of the general classification remained unchanged, with the overall contenders safely crossing the line in the peloton.

Luxembourg’s Bob Jungels of Quick-Step retained the overall lead, with Team Sky’s Geraint Thomas 6sec behind.

Thomas’ fellow Briton Adam Yates is a further four seconds behind, along with defending champion Vincenzo Nibali of Italy and 2014 winner Nairo Quintana of Colombia.

The International Cycling Union (UCI) WorldTour race will continue tomorrow with a 189km stage from Molfetta to Peschici.

The second stage of the women's Tour of California was won by Katharine Hall.

The American finished 21 seconds clear of her nearest rival Anna Van der Breggen on the stage.

Hall now holds the overall race lead, with Dutch rival Van der Breggen just three seconds adrift.

Megan Guarnier of the United States won the opening stage of the race and lies third at the UCI Women's WorldTour event, 29 seconds off the lead.

The men’s race will begin on May 14.