Andre Greipel won his third stage of this year's Giro d'Italia before leaving the race ©Getty Images

Germany's Andre Greipel earned an historic victory in the 12th stage of the Giro d'Italia today before quitting the race, despite holding the red jersey as the overall points leader.

It was Greipel's third stage win of this year's event and 20th Grand Tour stage victory of his career, six of them coming in the Giro.

That equalled the record of Erik Zabel as Germany’s most prolific winner in the Giro, Tour de France and Vuelta a España.

Greipel, riding for Lotto-Soudal, finished ahead of Australia's Caleb Ewan, representing Orica-GreenEdge, and Italy's Giacomo Nizzolo, in the colours of Trek-Segafredo, in 4 hours 16min 00sec at the end of the 182 kilometres stage from Noale to Bibione that had mostly taken place in driving rain. 

A series of 90 degree corners on a twisting circuit which had to be negotiated twice in the finish town led to the race jury deciding to take the overall time for the stage when they crossed the finish line for the first time, despite the eight kilometres circuit needing to be ridden a second time. 

The jury also ruled no time bonuses would be awarded on the line, leaving the main contenders including the overall leader, Luxembourg's Bob Jungels, free to take the second lap in a more comfortable fashion. 

Germany's Andre Greipel celebrates his third stage victory of this year's Giro d'Italia ©Getty Images
Germany's Andre Greipel celebrates his third stage victory of this year's Giro d'Italia ©Getty Images

"I'm sorry to leave the Giro but my season is full of goals and I need to rest," Greipel, who had declared his plan to quit the race before today's, said.

"I've already achieved so much at the Giro."

Jungels, representing Etixx-QuickStep, remains the overall leader and in possession of the pink jersey, the maglia rosa.

The 13th stage tomorrow is due to be a challenging, 170km mountainous route from Palmanova to Cividale del Friuli, including four categorised climbs