Just 53 seconds behind Quintana coming into the stage, Dumoulin, a strong time triallist, was the favourite to take the overall win, and although his efforts were not enough to deny compatriot Jos Van Emden the stage win, they were more than enough to give the Netherlands a first ever Giro d'Italia victory.
With just 29.3km to go at the end of one of the closest Grand Tours in history, there were four riders who could still take pink: Dumoulin, Quintana, Vincenzo Nibali (Bahrain-Merida) and Thibaut Pinot (FDJ).
Dumoulin was the first of that quartet to roll off the start ramp and onto the Monza motor racing circuit, flying through the first 8.8km to set the second fastest time at the first intermediate check.
Of the other three, Nibali fared the best in the opening kilometres, conceding 17 seconds, while Pinot and Quintana were further back at 28 and 33 seconds respectively.
From there the pattern was set for the rest of the race, with Dumoulin extending his advantage throughout the stage, eventually crossing the line in a time 33-23.
That may not have been enough for the stage win, but that mattered little to the Dutchman, who sat watching nervously as Nibali and Pinot came home, the Italian in a time that was good enough to finish third, while Pinot missed out on the podium.
The only man left on the course was Quintana, but as the Colombian came under the flamme rouge, he had only a minute to complete the final kilometre, a smile coming across the face of Dumoulin as he saw the time.
Quintana fought through the final kilometre, but it would not be enough, and he eventually finish 1-24 behind Dumoulin, who embraced his girlfriend as he celebrated a famous Giro d'Italia victory.
How it happened
Sunny skies, high temperatures, and light winds greeted the riders at the Monza motor racing circuit as they took on the final stage of the 2017 Giro d'Italia: a flat, 29.3km time trial from Monza to Milan that would decide the winner of the closest Grand Tour in living memory.
The early starters were a mixture of those soaking up the atmosphere and enjoying a stress-free end to the race, and those in search of a stage win.
Among the latter, it was fitting that Italian national time trial champion Manuel Quinziato (BMC Racing) set the fastest time early on, enjoying some time in the hot seat at the end of his final Giro d'Italia with retirement on the horizon at the end of the season.
However Quinziato's time didn't last long, with LottoNL-Jumbo's Jos Van Emden going 27 seconds faster in a time of 33-08, while one of the pre-stage favourites, Vasil Kiryienka (Team Sky), had to settle for a provisional third place, 31 seconds behind Van Emden.
The Dutchman's time was a good one, and as David Formolo (Cannondale-Drapac), 10th going into the stage, rolled off the ramp, Van Emden was still at the top of the standings.
Yates held an advantage of just 28 seconds at the start of the day, but had already lost half of that advantage by the first intermediate split.
From there the pattern was set, and Jungels continued to gain time throughout the 29.3km course, eventually crossing the line in a time of 34-02, good enough for eighth on the day, 1-34 ahead of Yates to win the white jersey.
However the big drama would come in the fight for the pink jersey, and Tom Dumoulin was the first of the major contenders to roll off the start ramp, looking to overturn a 53 second deficit to Nairo Quintana.
As expected the Dutchman flew through the opening kilometres, going just two seconds slowed than Van Emden at the first time check.
Things weren't looking quite so good for Pinot, 10 seconds ahead of Dumoulin at the start of of the day, who even managed to go slower than Yates at the first time check, going through 26 seconds slower than the Dutchman with a third of the stage completed. Nibali was looking in slightly better shape, but still saw his 14 second lead over Dumoulin disappear by the same point.
Quintana was also struggling, and by the first time check he had seen more than half of his 53 second advantage disappear.
From there the race looked to be Dumoulin's to lose, looking resplendent in his Dutch national champion's skinsuit as he sped along the wide boulevards on the way into Milan.
The second time check brought more good news for Dumoulin as he again set the second fastest split, just six seconds down on Van Emden.
Meanwhile Pinot was losing further time, 53 seconds behind the flying Dutchman by the 17.4km time check, while Nibali was able to go slightly faster, 37 seconds behind Dumoulin.
The last man to reach the intermediate point was the pink jersey, but Quintana was slipping further and further back, setting a time that was only good enough for 30th, one minute behind Dumoulin who was now in the virtual maglia rosa.
As things stood Dumoulin would win by just three seconds, but with 12km to go there was still time for him to extend his lead to secure a more comfortable margin of victory.
By the final kilometre Dumoulin was starting to rock and roll, bobbing from side to side and gulping in air as he went through the final corners. One final sprint to the line, tucked back on his aero position, and it was done.
The time was 33-23, not enough to win the stage, which went to Van Emden by 15 seconds, but surely enough to win the Giro d'Italia overall.
Thibaut Pinot and Vincenzo Nibali would be the next two riders to cross the line, but the earlier time checks had shown that they wouldn't be a threat.
Pinot lost nearly a minute, while Nibali fared slightly better, the huge crowds in the centre of the Milan cheering the Sicilian to 13th place on the day, guaranteeing him a place on the final podium
Eyes now fell on the pink skinsuit of Nairo Quintana, but as the Colombian came under the flamme rouge needing to cover the final kilometre in just a minute, a smile started to spread across the face of Dumoulin.
From there there was no way that Quintana could do, and despite a valiant effort as he pushed the limits through the final few corners, he came home well short, with Dumoulin winning the 100th edition of the Giro by just 31 seconds.
Giro d'Italia 2017, stage 21: Monza to Milan (29.3km)
1. Jos Van Emden (Ned) Team LottoNl-Jumbo, in 33-08
2. Tom Dumoulin (Ned) Team Sunweb, at 15 secs
3. Manuel Quinziato (Ita) BMC Racing Team, at 27 secs
4. Vasil Kiryienka (Blr) Team Sky, at 31 secs
5. Joey Rosskopf (USA) BMC Racing Team, at 35 secs
6. Jan Barta (Cze) Bora-Hansgrohe, at 39 secs
7. Georg Preidler (Aut) Team Sunweb, at 51 secs
8. Bob Jungels (Lux) Quick-Step Floors, at 54 secs
9. Jan Tratnik (Slo) CCC Sprandi Polkowice, at 57 secs
10. Andrey Amador (CRc) Movistar Team, at 1-02
Giro d'Italia 2017: final general classification
1. Tom Dumoulin (Ned) Team Sunweb, in 90-34-54
2. Nairo Quintana (Col) Movistar Team, at 31 secs
3. Vincenzo Nibali (Ita) Bahrain-Merida, at 40 secs
4. Thibaut Pinot (Fra) FDJ, at 1-17
5. Ilnur Zakarin (Rus) Katusha-Alpecin, at 1-56
6. Domenico Pozzovivo (Ita) AG2R La Mondiale, at 3-11
7. Bauke Mollema (Ned) Trek-Segafredo, at 3-41
8. Bob Jungels (Lux) Quick-Step Floors, at 7-04
9. Adam Yates (GBr) Orica-Scott, at 8-10
10. Davide Formolo (Ita) Cannondale-Drapac, at 15-17
Mark Cavendish spotted cycling in central London
Cavendish will race in the World Championships on Sunday 26 September, but needed to get some miles in his legs in London
By Ryan Dabbs •
See and be seen with the Garmin Varia rearview radar and tail light
Garmin’s clever tail light alerts you to approaching vehicles as well as upping your road presence
By Cycling Weekly •
Road World Championships 2021: women’s individual time trial start list
List of starters for the elite women's individual time trial at the 2021 UCI Road World Championships at Bruges on Monday 20 September
By Ryan Dabbs •
Vuelta a España 2021 route: Nine summit finishes and no Madrid finale in this year's edition
The route for the third and final Grand Tour of the season is set to test the legs with nine uphill finishes
By Tim Bonville-Ginn •
Egan Bernal tests positive for Covid-19 days after Giro d’Italia victory
The Colombian star had been scheduled to return home after winning the Giro but will now self-isolate in Europe
By Alex Ballinger •
Giro d’Italia was Remco Evenepoel’s ‘first defeat,’ says Patrick Lefevere
Evenepoel went into the Giro as one of the favourites despite a lack of racing due to injury
By Alex Ballinger •
Giro d'Italia 2021 ratings: how did each team perform?
Team ratings from the 2021 Italian Grand Tour
By Stephen Puddicombe •
Egan Bernal 'empty' after Giro victory, doesn't think he'll be able to race Tour de France
Egan Bernal won the Giro d'Italia 2021 but doesn't think he'll be good enough to go on to race the Tour this summer
By Jonny Long •
Five talking points from stage 21 of the Giro d'Italia 2021
The final talking points from the 104th Giro d'Italia
By Stephen Puddicombe •
Giro d'Italia 2021 standings: The final results from the 104th edition
Giro d'Italia 2021: all the standings for the stages, overall, mountains, points, best young rider and team standings throughout the race
By Tim Bonville-Ginn •