Tom Dumoulin produced a sensational individual time trial to win the 100th Giro d'Italia in Milan by 31 seconds.
The Dutchman, 26, started Sunday in fourth, 53 seconds behind leader Nairo Quintana but beat the Colombian by more than a minute on the 29.3km last stage.
Quintana, chasing the first leg of a Giro-Tour de France double, had to settle for second place overall.
Dumoulin also leapfrogged defending champion Vincenzo Nibali and Thibaut Pinot, who dropped to third and fourth.
"It's really crazy," said Team Sunweb rider Dumoulin, who became the first Dutch winner of the Giro and the first rider from his country to win a Grand Tour since Joop Zoetemelk's victory in the 1980 Tour de France.
"This is incredible. It was such a nerve-wracking day but I had good legs and I just went for it.
"I would have been really happy with a stage win and that would have been a successful Giro for me. I didn't think that this was something I could do."
Britain's Adam Yates was beaten in the race for the white jersey, awarded to the quickest rider under the age of 25, by Luxembourg's national time trial champion Bob Jungels.
Yates, 24, started the time trial with a 28-second advantage over Jungels, but the Luxembourger's time of 34 minutes two seconds was more than one minute quicker than Yates, who finished a creditable ninth overall.
Jos van Emden won the stage in a time of 33:08, 15 seconds clear of Dumoulin, who crossed the line in 33:23 to claim second and he then had an agonising wait for first Pinot, then Nibali and finally Quintana to reach the finish.
Movistar's Quintana, the 27-year-old 2014 Giro champion, and twice winner Nibali, 32, are climbing specialists and knew they would struggle to defend their advantage on a flat route more suited to time trial specialists.
And so it proved with Dumoulin quickly erasing the time gaps the riders ahead of him had built after 20 stages of racing.
His winning margin is not the narrowest in Giro history, with Fiorenzo Magni triumphing by just 11 seconds in 1948. The closest win in Grand Tour history was Frenchman Eric Caritoux's six-second victory at the 1984 Vuelta, while Greg LeMond won the 1989 Tour de France by eight seconds.
Britain's Geraint Thomas, who started the race as co-leader of the Team Sky squad with Mikel Landa, was forced to pull out after crashing on stage nine.
Landa took the consolation of winning the King of the Mountains jersey.
1. Tom Dumoulin (Ned/Sunweb) 90hrs 34mins 54secs
2. Nairo Quintana (Col/Movistar) +31secs
3. Vincenzo Nibali (Ita/Bahrain) +40secs
4. Thibaut Pinot (Fra/FDJ) +1min 17secs
5. Ilnur Zakarin (Rus/Katusha) +1min 56secs
6. Domenico Pozzovivo (Ita/AG2R) +3mins 11secs
7. Bauke Mollema (Ned/Trek) +3mins 41secs
8. Bob Jungels (Lux/Quick-Step) +7mins 04secs
9. Adam Yates (GB/Orica) +8mins 10secs
10. Davide Formolo (Ita/Cannondale) +15mins 17secs
Stage 21 result:
1. Jos van Emden (Ned/LottoNL) 33mins 08secs
2. Tom Dumoulin (Ned/Sunweb) +15secs
3. Manuel Quinziato (Ita/BMC Racing) +27secs
4. Vasil Kiryienka (Blr/Team Sky) +31secs
5. Joey Rosskopf (US/BMC Racing) +35secs
6. Jan Barta (Cze/BORA) +39secs
7. Georg Preidler (Aut/Sunweb) +51secs
8. Bob Jungels (Lux/Quick-Step) +54secs
9. Jan Tratnik (Slo/CCC) +57secs
10. Andrey Amador (Crc/Movistar) +1min 02secs