The German won the 182km 12th stage from Noale to Bibione in a sprint as the top of the general classification standings remained unchanged.
Greipel (Lotto-Soudal) finished ahead of Australian Caleb Ewan (Orica-GreenEdge) and Italian Giacomo Nizzolo (Trek-Segafredo), and was in possession of the points leader’s red jersey when he quit the race.
“I’m sorry to leave the Giro with the maglia rosa but my season is full of goals and I need to rest,” said Greipel.
“I’ve already achieved so much at the Giro.”
Greipel will be among those looking to win the Tour de France opening stage on July 2; the World Championships in Qatar in October is also a target.
Bob Jungels (Etixx-QuickStep) remains the overall leader and in possession of the pink jersey, the maglia rosa.
Ireland’s Team Sky pairing of Philip Deignan and Nicolas Roche had rather uneventful days on the pan-flat stage and rolled across the line in the same time as Greipel.
They’ll have been glad of the easier day as today’s 13th stage is a 170km mountainous route from Palmanova to Cividale del Friuli.
Meanwhile, Cycling Ireland announced yesterday that this year’s national championships, scheduled to take place in five weeks in the Phoenix Park, will need a new venue.
Gardaí say a major security operation will be held in the park from June 23-26, ruling out its use for the championships.
Because so many gardaí will be needed for the security event, finding another Dublin venue for the championships will not be possible because the force will not have the numbers available to police it.