2012 Giro d'Italia, Stage 12 to Stage 21

Stage 12 of the 2012 Giro d'Italia was contested on 17 May, and the race concluded with Stage 21 on 27 May. The second half of the race was situated entirely within Italy; starting with a medium mountain stage from Seravezza to Sestri Levante, before the customary race-concluding time trial was held in Milan.

Following his victory in the tenth stage, 's Joaquim Rodríguez held the lead into the second half of the race. He maintained his lead on stage 12 – after the breakaway succeeded in staying away until the end of the stage as rider Lars Bak held on to win by eleven seconds ahead of the remnants of the breakaway group – and on stage 13, as Mark Cavendish picked up his third stage victory of the race on one of the few sprinter-suited stages during the second half of the race. Rodríguez gave up the lead of the race at the end of stage 14, after rider Ryder Hesjedal attacked on the climb to the stage finish at Cervinia – the first that the climb had featured in the Giro since 1997 – taking 26 seconds out of his rival, and reclaimed the maglia rosa that he held for three days in the first half of the race.

Rodríguez immediately retook the lead of the race the following day at the summit finish at the Pian dei Resinelli. Although he finished second to rider Matteo Rabottini on the day, Rodríguez gained 39 seconds on Hesjedal through his late-stage attack. After the race's second rest day which came after that stage, the gap between Rodríguez and Hesjedal remained at the half-minute mark for the next three stages; the breakaway succeeded once again on stage 16 as rider Jon Izagirre soloed away from a group of riders in the closing stages, while on stage 17, Rodríguez won the stage after a group of the leading overall contenders escaped on the Passo Giau. Also among that group were Hesjedal, former winners Ivan Basso and Michele Scarponi, with  rider Rigoberto Urán and 's Domenico Pozzovivo making up the sextet. Stage 18 saw the sprinters' last chance of victory with Andrea Guardini of edging out Cavendish for victory.

Hesjedal and Rodríguez took near-identical gaps out on one another during stages 19 and 20; Hesjedal reduced the lead to 17 seconds in the former stage finishing at the Alpe di Pampeago, while Rodríguez moved it back out to 31 seconds following the Cima Coppi finish at the Stelvio Pass. rider Thomas De Gendt moved into overall podium contention by winning the stage to the Stelvio, taking between three and five minutes from all of the other overall contenders, and moved from ninth place to fourth place at the end of the stage. Hesjedal's better time trial abilities enabled him to take the lead of the race on the final day from Rodríguez; he overturned the 31-second deficit, and ultimately became the first Canadian rider to win a Grand Tour. Hesjedal had turned the deficit into a 16-second margin of victory, the closest such margin since Eddy Merckx beat Gianbattista Baronchelli by 12 seconds in the 1974 edition of the race. De Gendt moved ahead of Scarponi for third place, to become the first Belgian rider to finish on a Grand Tour podium since Johan Bruyneel finished third at the 1995 Vuelta a España.

Stage 12

 * 17 May 2012 — Seravezza to Sestri Levante, 155 km

The stage had been scheduled to be held over a distance of 157 km, but in April 2012, prior to the start of the Giro, the itinerary was changed slightly to 155 km. Due to torrential rains which caused floods and mudslides in October 2011, the roads through the Cinque Terre were considered unusable for the race. As such, the second half of the race began with an undulating stage along the Ligurian coast, with four categorised climbs over the parcours, the last of which coming just 11 km from the stage finish in Sestri Levante. Mini-attacks set the course for the stage as the field remained as one, for much of the first hour of racing; it was not until after 40 km that the stage's primary breakaway had been formed. An initial move of seven riders representing seven different teams went clear, with the septet later joined by two more riders, Jackson Rodríguez and 's Martijn Keizer, the latter again making it into the breakaway move.

's Sandy Casar was the best-placed of the nine riders in the group, trailing overnight leader Joaquim Rodríguez by four minutes, and as the stage wore on, became more of a threat to Rodríguez's lead. The breakaway's gap surpassed that figure, reaching a high of seven minutes, with 40 km remaining on the stage. As set the pace on the front of the peloton,  rider Michał Gołaś soloed off the front of the lead group, but he was caught prior to the summit of the day's final climb, the Villa Tassani. More attacks occurred between the leaders prior to the finish, but Lars Bak produced the decisive attack with 2 km remaining, and eventually went clear to an 11-second winning margin at the finish, winning his first individual Giro stage. Casar led a group of six riders across in second, but his time gap to the peloton was only 3' 23". Despite the twelve bonus seconds on offer for second at the line, Casar was still 26 seconds shy of taking the race lead, but moved into third in the general classification, behind Rodríguez and 's Ryder Hesjedal.

Stage 13

 * 18 May 2012 — Savona to Cervere, 121 km

At 121 km, stage 13 was the shortest non-time trial stage of the entire Giro; again, the stage was undulating, with only one categorised climb at Montezemolo, 31.7 km into the itinerary. The stage was ideally set for the sprinters, potentially their last possible attempt to win a stage, with the final week of the Giro set to be all about the climbers and overall contenders for the race. The primary breakaway of the stage was formed early in the stage, when rider Martijn Keizer and 's Francesco Failli went clear in the opening stages of the day's running. By the 30 km point of the stage, the lead duo held their maximum lead of the day, when they were five-and-a-half minutes, after the peloton – led by and  – elected to ease their pace.

The peloton steadily closed down the lead duo after that climb, and with around 20 km to go in the stage, Keizer and Failli were absorbed by the main pack. Once they were all together, the pace slowed again as many teams tried to get their protected riders into a safe enough position prior to the finish in Cervere. Having slowed the pace before, were on the front again, hoping to set up the sprint for their sprinter, Arnaud Démare; they were later joined on the front by the  and  teams, both of whom were looking to set up their respective Australian sprinters Mark Renshaw and Matthew Goss. Inside the final 10 km, three riders – Julien Bérard of, 's Julien Vermote and rider Fabio Felline tried to advance clear to alleviate an expected bunch sprint, but the sprint trains of  and  managed to close them down. Brett Lancaster launched Goss into his sprint, with Mark Cavendish on his wheel. Cavendish tried to come down the left of Goss in the closing metres, but Goss closed the gap and Cavendish had to drop his pace, but recovered effortlessly and took Goss, and held on to win his third stage of the Giro. His 33rd Grand Tour stage win, Cavendish also extended his lead in the points classification, as Goss could only finish sixth behind 's Alexander Kristoff, Renshaw, rider Sacha Modolo and Elia Favilli of. Goss left the race following the stage, further extending Cavendish's lead.

Stage 14

 * 19 May 2012 — Cherasco to Cervinia, 206 km

The first categorised mountain stage of the race featured a near-flat opening 137 km to the stage, before almost 50 km worth of climbing in the remainder of the stage, with two first-category climbs, the Col de Joux – climbing up to an altitude of 1640 m – and the finishing climb to Cervinia, reaching up to a height of 2001 m via an average gradient of 5.5% over the 27 km. The climb to Cervinia was being used in the race for the first time since 1997, when eventual race winner Ivan Gotti took the race lead from Pavel Tonkov, and never relinquished the lead to the end of it. Prior to the stage, a minute's silence was held as a mark of respect to victims of a bombing at a school in Brindisi, earlier in the day.

With the stage parcours as such, there were no major movements off the race for the first hour of racing, before the weather conditions changed; rain would play in the rest of the day's proceedings. Eight riders went clear at around the 60 km mark, building up a lead of in excess of thirteen minutes over the main field. Three of the eight were dropped on the lower parts of the Col de Joux, while set the pace on the front of the field, reducing their advantage to around ten-and-a-half minutes. 's Jan Bárta had gone clear, while José Rujano had linked up with  rider Damiano Cunego to try and chase him. They could not do so, and instead it was left to Andrey Amador of the to foot the chase to Bárta. He caught him and eventually proceeded to drop him on the descent, and held a half-minute lead by the time he had reached the final climb to Cervinia. He extended the lead on the lower slopes of the climb itself, and soon held an advantage of over a minute over Rujano's team-mate Alessandro De Marchi, 's Matteo Montaguti, Bárta and 's Pierpaolo De Negri.

De Marchi and Bárta both later made solo attacks out of the group, and eventually caught up to Amador as the peloton grew ever-closer on the parcours. The peloton had been around five minutes behind with 10 km remaining, but the gap had been halved by the time they had reached the 5 km to go mark. De Marchi tried to break his two companions but could not do so; while in the peloton, there were several movements but it was not until Ryder Hesjedal got clear for that there was more animation in the peloton. Joaquim Rodríguez tried to follow his rival but was ultimately unsuccessful. At the front however, it was down to the three leaders for the sprint; Bárta tried to launch his sprint first, but fell short at the line as Amador achieved the first stage victory for a Costa Rican rider in any Grand Tour. De Marchi finished a couple of seconds behind in third, while Hesjedal gapped the Rodríguez group by 26 seconds to retake the maglia rosa. Hesjedal later stated that his attack on the climb was "unplanned", and that he was confident of taking the race victory in Milan.

Stage 15

 * 20 May 2012 — Busto Arsizio to Lecco–Pian dei Resinelli, 169 km

Just like the previous day's stage, the first element of the stage was largely flat, before approaching the first of four categorised climbs, the Valico di Valcava. After the descent from the climb and another uncategorised climb immediately after, the riders took in the third-category Forcella di Bura before two second category climbs; the Culmine di San Pietro with its summit at 25 km remaining, as well as the final climb of the Pian dei Resinelli. Heavy rain again dominated the roads, with fog in places, making conditions treacherous for any major attacks. The breakaway was instigated by a pair of riders at the 18 km mark, when rider Guillaume Bonnafond and 's Matteo Rabottini were allowed to get clear. Bonnafond and Rabottini soon garnered a gap of around nine minutes some 30 km later, but the pair reached the footslopes of the Valico di Valcava with an eight-minute lead.

At the same time as seven riders making their break from the -led peloton, Rabottini soon left Bonnafond on the climb, beginning a solo attack of the parcours. Five riders also bridged up to the chase group, making it a dozen riders chasing after Rabottini on the road. Rabottini crossed the summit almost five minutes clear of the chasers, with the peloton several minutes further behind. and continued to set the pace on the front of the main group, looking to bring Ryder Hesjedal and Ivan Basso back into the equation for the overall classification. Rabottini suffered a crash inside the final 30 km of the stage, but still held an advantage of over two minutes to the chase group. took their turn on the front of the peloton, with numbers reducing in the gruppetto down to around twenty riders.

Rabottini took a lead of two-and-a-half minutes into the final 10 km of the stage, but Stefano Pirazzi launched an attack from the chase group for ; his second such attack of the stage, having attacked on the Culmine di San Pietro, before he was closed down by other riders. With Damiano Cunego and Amets Txurruka  marking each other in the small group, 's Alberto Losada counter-attacked, and Cunego could not follow his move as Txurruka joined Losada. Losada went clear of Txurruka and Pirazzi and set off after Rabottini, while in the group of overall contenders, Cunego's team-mate Michele Scarponi attacked with only Basso, 's Sergio Henao and Joaquim Rodríguez for company. Rodríguez accelerated further, catching and passing Pirazzi and Txurruka, while team-mate Losada waited for him to help his team-mate on the climb; he carried on without Losada, catching Rabottini inside the final 300 m. Rabottini latched on to Rodríguez, and took him on the outside of the final left-hand turn and beat him to the line for his first victory since the 2011 Tour of Turkey. Rodríguez reclaimed the maglia rosa from Hesjedal, while fourth-placed Henao claimed the young rider classification lead from team-mate Rigoberto Urán.

Stage 16

 * 22 May 2012 — Limone sul Garda to Falzes-Pfalzen, 173 km

Following the second and final rest day of the race the previous day, the race returned with a stage classified "medium-mountain" without any categorised climbs over the 173 km parcours. Despite this, the stage gradually rose during its course, before reaching the highest point at the finish – via a closing climb with a gradient reaching 12% in places, yet uncategorised – in Pfalzen, 998 m above sea level. After a previous thirteen-rider breakaway move had earlier been unsuccessful, a second batch of ten riders launched their attack on the peloton after around 60 km, but none of the riders posed a threat to overall leader Joaquim Rodríguez ; the best-placed rider of the group was 's José Herrada, who was over 32 minutes behind Rodríguez at the start of the stage.

With such an advantage over their rivals in the lead group, the peloton elected not to chase them down at any point, and as such, the gap to them moved up to an unassailable advantage of almost 13 minutes with under 30 km remaining in the stage. While the main field managed to marginally cut into the lead that the breakaway had held, inside the final 10 km, with upping the tempo to allow their jersey-wearers Mark Cavendish (points) and Sergio Henao (young rider) to stay out of the way of any potential hazards in the closing stages. At the front, 's Mathias Frank chased down moves by Herrada, rider Alessandro De Marchi and Jon Izagirre of, but Izagirre managed to break the confines of the group with around 4 km to go. Izagirre was not caught, eventually soloing away to a 16-second victory for his first Grand Tour win, and second in a month after a previous victory in the time trial of April's Vuelta a Asturias. De Marchi beat Stef Clement for second place, while the peloton trimmed the gap to the breakaway to under nine minutes at the finish, following injections of pace from  and.

Stage 17

 * 23 May 2012 — Falzes-Pfalzen to Cortina d'Ampezzo, 186 km

Following the previous day's summit finish in Pfalzen, the race continued in the Dolomites with four high-mountain passes over the 186 km parcours, culminating in the first-category Giau Pass, the highest point of the previous year's race. The Passo Giau, a 9.9 km climb reaching up to an altitude of 2236 m – an average gradient of 9.3% – was set to break up the peloton prior to the near-20 km descent into Cortina d'Ampezzo; where the race was being hosted by the town for the first time since 1977. With much of the focus upon those closing climbs – three inside the final 70 km of the stage – with the Passo Duran and the Forcella Staulanza coming before the Passo Giau, there was no immediate breakaway from the start.

Instead, it was not until the end of the first hour of racing that the breakaway had been instigated. Five riders broke the confines of the peloton at the 35 km mark, consisting of mountains classification leader Matteo Rabottini, José Serpa of , rider Kevin Seeldraeyers as well as 's Branislau Samoilau and Matteo Montaguti representing the  team. The quintet held a lead of almost six minutes on the stage's first climb, the Passo Valparola, but their advantage was cut by the time Rabottini had extended his mountains points lead, by cresting the summit first. and were the prominent teams on the front of the field, with  rider Mikel Nieve eventually attacking off the front, replacing Montaguti as the fifth member of the breakaway, as he had been dropped. All five were later caught before the Passo Giau, where the squad were again leading the reduced peloton. As was expected, the Passo Giau defined the remainder of the stage.

With three riders setting the pace for their team captain Ivan Basso, numerous riders were being dislodged from the back of the group; as such, only six riders remained with the group halfway up the climb, with Basso being joined by overall leader Joaquim Rodríguez, 's Ryder Hesjedal,  rider Michele Scarponi, as well as Rigoberto Urán of  – after team-mate Sergio Henao had been dropped – and  rider Domenico Pozzovivo. Scarponi and Urán were both dropped in the closing stages of the Passo Giau, but they both made it back into the lead group on the descent into Cortina d'Ampezzo; the sextet battled it out for the stage honours in a sprint finish, where Rodríguez came from last position in the line to out-sprint his rivals for his second stage win of the race. His overall lead remained at 30 seconds however, as there was no bonus seconds on offer at the finish; but he also stated that Hesjedal was the favourite, due to his superior abilities in the time trial. Rodríguez also dedicated his stage victory to Xavier Tondo, on the first anniversary of his death while preparing for a training session. The only jersey to change hands at the end of the stage was Urán, moving into fifth place overall, taking the young rider classification lead from team-mate Henao.

Stage 18

 * 24 May 2012 — San Vito di Cadore to Vedelago, 149 km

Starting from a height of 974 m above sea level, the stage steadily descended throughout its entire 149 km parcours, except for a few lumps, all the way down to Vedelago at just 45 m above sea level. The stage was set up for the sprinters' final chance to claim stage honours in the race; the following two stages were summit finishes in the high mountains – ruling the sprinters out of contention – before the race-concluding individual time trial in Milan. The finish in Vedelago came after a 5 km straight run-in, with no potential hazards for late crashes. The opening breakaway of the stage came after just 3 km, when four riders attacked off the front of the peloton. The breakaway was made up of Pierpaolo De Negri, rider Angelo Pagani, 's Stef Clement, and Manuele Boaro of , but with Clement being best-placed at over an hour down on overall leader Joaquim Rodríguez , there was no real hurry to close them down.

The leaders held a lead of around three minutes at the conclusion of the first hour of racing, but were on the front of the peloton in the hopes of extending the points classification lead that Mark Cavendish held over Rodríguez; prior to the stage, Cavendish held a one-point lead over the race leader, after Rodríguez's victory in stage 17. Ian Stannard was given the main duties of setting the tempo, following the withdrawal of Peter Kennaugh during stage 17, and managed to bring the breakaway back prior to the intermediate sprint point; Cavendish led across the line in Cesiomaggiore, following a lead-out from Geraint Thomas. Several mini-attacks occurred prior to a second breakaway being instigated.

Clement was again part of a quartet in front, being joined by rider Olivier Kaisen and 's Martijn Keizer – the two most active riders in the Premio della Fuga classification for most cumulative kilometres spent in a breakaway of fewer than ten riders – with Mickaël Delage completing the quartet for. remained at the front of the peloton with added assistance from, as they looked to keep the breakaway's advantage as little as possible; it was around a minute with 45 km to go. Delage later advanced clear on his own with 14 km to go, with Kaisen's team-mate Lars Bak attacking out of the peloton once again to join him in a short stint off the front; the pair were caught inside of 4 km to go, setting up the bunch sprint. Bernhard Eisel and Thomas positioned Cavendish at the head of the bunch, but Andrea Guardini finished quickest, having launched his sprint off the wheel of 's Roberto Ferrari, and the eleven-time Tour de Langkawi stage winner took his first Giro stage victory. Guardini's win came after he had been criticised by the Italian media prior to the stage. Cavendish extended his points lead to 29 with second at the line, while Rodríguez maintained his 30-second lead in the overall classification.

Stage 19

 * 25 May 2012 — Treviso to Alpe di Pampeago, 198 km

Like several of the other mountain stages during the Giro to that point, the stage started just above sea level in Treviso before steadily climbing back towards the Dolomites, and the foot of the first of five categorised climbs during the stage, the third-category Sella di Roa. Having descended from that climb, the riders were then immediately climbing once again after that, with the first-category Passo Manghen, a 20.5 km climb with an average gradient of 7.4%; before the first of two ascents of the finishing climb at the Alpe di Pampeago, the first of which going to the Reiterjoch, reaching 2006 m in altitude. On the finishing circuit of 38 km, the riders encountered the second-category Passo di Lavazè, before the Alpe di Pampeago once again. It was expected that this stage, rather than the queen stage 20, would cause the most alterations in the general classification, but the race winner would become clearer over the two stages, and the final time trial.

Seventeen riders representing seventeen different teams made it into the breakaway at the 20 km mark, including the most recent winner of a stage finishing at the Alpe di Pampeago, 's Emanuele Sella, who won the stage by more than four-and-a-half minutes in 2008. As well as Sella, rider Sandy Casar was part of the breakaway, who in 19th place, was the highest-placed rider in the general classification, having trailed overall leader Joaquim Rodríguez  by 12' 25" overnight. By the time that the lead group had reached the Passo Manghen, the advantage was around the ten-minute mark. With Rodriguez's team, as well as the teams of Ivan Basso  and Michele Scarponi, that advantage steadily fell during the stage, and the margin had been more than halved by the intermediate sprint point of the stage, coming prior to the first ascent of the Alpe di Pampeago, in Tesero.

On the climb, Casar pulled clear with Tirreno–Adriatico mountains classification winner Stefano Pirazzi of and 's Thomas Rohregger. Rohregger faded on the climb, and Pirazzi and Casar went clear to the summit. Approaching the summit in the peloton, rider Dario Cataldo went clear off the front of the pack, and was joined by  pairing Kevin Seeldraeyers and Roman Kreuziger; Kreuziger and Cataldo then left Seeldraeyers behind, and joined up with Cataldo's team-mate Serge Pauwels, who had dropped back from the breakaway. Sella had bridged himself back up to Rohregger, with both riders later rejoining Casar and Pirazzi at the 11 km to go mark; the group only remained together for another 4.5 km as Casar and Pirazzi again ventured clear of the other pair. By now, Kreuziger and Cataldo had gathered ground on Rohregger and Sella, joining them after the latter pair had no response to the attack.

Pirazzi went clear again, with Kreuziger and Casar trying to follow, while in the main bunch, Scarponi was trying to break the group up into a handful of riders, but it was not until Ryder Hesjedal attacked with 2.5 km remaining that the group splintered. Kreuziger went past Pirazzi and eventually soloed away to his first Giro stage victory, although he – and directeur sportif Giuseppe Martinelli – remained disappointed with his Giro as a whole. Behind, Hesjedal attacked once again, and was not chased down; eventually gaining thirteen seconds on Rodríguez, reducing the latter's advantage to 17 seconds ahead of the final two stages of the race. Scarponi, who finished fourth on the stage behind Rodríguez, moved into third place overall; a 20-second margin over Basso on the stage swung third place in the defending champion's favour by six seconds. Both Rodríguez and Basso felt that the Giro title was Hesjedal's to lose, due to the final stage time trial.

Stage 20

 * 26 May 2012 — Caldes–Val di Sole to Stelvio Pass, 219 km

The race's queen stage consisted of five categorised climbs over the 219 km parcours. Having commenced the stage with the second-category climb of the Passo del Tonale, the riders contended with a pair of contrasting third-category climbs; the Passo dell'Aprica, a shallow 16 km climb with an average gradient of just over 3%, and the Teglio, a near-6 km climb averaging 8%, although reaching 15% in places. Undulating roads set the course for the next hour of racing, up to the foot of the first-category Passo del Mortirolo. The Passo del Mortirolo, returning to the race after being absent in 2011, averages a gradient of in excess of 10% over its 11 km length, although the gradient reached 22% in places on the climb. Having descended from there, the riders headed towards Bormio and the start of the climb to the Cima Coppi – the highest point of the Giro d'Italia – of the Stelvio Pass. Although not as steep as the Passo del Mortirolo, the Stelvio Pass was a 22.4 km climb with an average gradient of only 7%, with the final 3 km being the steepest part of the climb, with 12% gradient recorded in certain areas.

Another large breakaway group was formed on a mountain stage, as fourteen riders went clear, including the previous day's winner Roman Kreuziger, former young rider classification leader Damiano Caruso of the team, and incumbent mountains classification leader Matteo Rabottini, looking to extend his advantage in that classification for. They held a lead of up to six minutes at one point in the early running of the stage, but as the group headed towards the foot of the Passo del Mortirolo, their advantage had been cut in half to around the three-minute mark. It was here that the group started to break apart, and it was an attack by Oliver Zaugg of that sent him up the road, having shaken off Matteo Carrara, who had bridged up to him on the climb. Carrara's team-mate Thomas De Gendt, ninth overall overnight, then attacked off the front of the peloton and caught up to Carrara, with both riders joined by 's Damiano Cunego, who was just behind De Gendt in the general classification.

then set their sights on getting riders up towards the front, with stage 16 winner Jon Izagirre and Mikel Nieve – winner of the stage to Val di Fassa in 2011 – making their way forward, and also in the process, brought Tanel Kangert of the team into the group, making it a six-man group in chase of Zaugg. Zaugg was caught with around 30 km remaining on the stage, while Carrara was replaced in the lead group by another stage-winner from the race, 's Andrey Amador. At this point, the group held a four-minute advantage over the reduced peloton, moving De Gendt and Cunego into contention of getting into the top three overall ahead of the time trial. De Gendt attacked again, which reduced the lead group yet further; once it had settled down once again, only De Gendt, Cunego and Nieve remained together. A third attack by De Gendt later followed and neither of his remaining breakaway companions could match his pace. With 10 km to go, De Gendt extended his advantage to five minutes over the -led peloton, putting overall leader Joaquim Rodríguez in a spot of danger, especially due to De Gendt's superior time trial capabilities.

De Gendt started to tire during the climb of the Stelvio, and with John Gadret attacking from the main field, the gap that he had over the main field was reducing. Ryder Hesjedal lifted the pace in the peloton, reducing the group yet further – to himself, Rodríguez and 's Michele Scarponi – inside the final 5 km. As De Gendt won the stage, Scarponi launched forward, and was closely followed by Rodríguez, with no movement from Hesjedal. Cunego finished second ahead of Nieve, while Rodríguez managed to catch and pass Scarponi for fourth on the stage; this result also gave him the lead in the points classification, taking over from Mark Cavendish by just one point. Hesjedal finished 14 seconds behind Rodríguez, to trail by 31 seconds going into the final 30.9 km time trial stage, while De Gendt moved up to fourth place, 2' 18" in arrears. Rodríguez's directeur sportif Valerio Piva later stated that it would be "difficult" for his rider to win the Giro, due to the close proximity of Hesjedal in the general classification.

Stage 21

 * 27 May 2012 — Milan, 28.2 km, individual time trial (ITT)

Originally scheduled for a distance of 30.9 km, the time trial was reduced to a distance of 28.2 km on the morning of the stage due to road conditions in Milan. The parcours of the stage itself was almost completely pan-flat, with a maximum altitude gain of just 14 m. As was customary of time trial stages, the riders set off in reverse order from where they were ranked in the general classification at the end of the previous stage. It was scheduled to be 's Andrea Guardini, but he was disqualified the previous day – along with three other riders – for holding on to their respective team cars. Thus, Miguel Minguez of, who, in 157th place, trailed overall leader Joaquim Rodríguez by five hours, twenty-five minutes and one second, was the first rider to set off on the final stage. He was not the first rider to finish, as 's Taylor Phinney passed both Minguez and his team-mate Adrián Sáez on the course, despite running off course after a mistake by the motorcycle in front of him, leaving Phinney frustrated at the finish.

Phinney's time held for only a number of minutes as Alex Rasmussen, who was third in the opening stage time trial in Denmark, assumed top spot for in a time of 34' 06". Almost quarter of an hour passed before Rasmussen was moved from the top of the timesheets, as 's Jesse Sergent was the first rider to break the 34-minute barrier as he recorded a time of 33' 59" for the course. Sergent's time stood for an hour before rider Geraint Thomas bettered his time by a margin of 14 seconds, but just like the opening stage of the race, his time was eventually only good enough for a second place stage result. Again, Thomas was beaten by a rider, but on this occasion it was Marco Pinotti and not Phinney, that recorded the quickest time for the course. Pinotti passed the two riders that started before him on the course, and completed the course in a time of 33' 06", 39 seconds better than Thomas and good enough for the five-time Italian time trial champion to take the stage victory, bookending victories in the race for his team.

The focus then shifted to the overall classification and the battle for the podium. Ryder Hesjedal was considered the favourite to take the final maglia rosa due to him being more proficient in the discipline than Rodríguez. 's Thomas De Gendt was also tipped to take at least third place, as he was in a similar situation to Hesjedal, against defending champion Michele Scarponi. De Gendt was first to take to the stage, recording a time of 34' 07" – good enough for a fifth-place finish – and was more than enough to move ahead of Scarponi, who recorded a time of exactly 35 minutes. Hesjedal had moved ahead of Rodríguez on time during the stage, and finished the course eight seconds slower than what De Gendt had achieved. He sealed the Giro title – and the first Grand Tour overall victory for a Canadian rider – several minutes later as Rodríguez finished outside of the 31-second margin that he had held before the stage. Rodríguez – who crashed during a reconnaissance run of the course – finished the stage in 35' 02", meaning that he finished the Giro with just the points classification, as Mark Cavendish was unable to finish the stage inside the top 15. De Gendt's third place meant that there was no Italian on the overall podium for the first time since 1995.