British rider Simon Yates produced a stunning performance on the penultimate stage of the Giro d'Italia to snatch the pink jersey from Isaac del Toro and effectively ensure his second Grand Tour title.
Del Toro came into the 20th and final competitive stage of the race with a 43-second lead over Richard Carapaz, with Yates trailing by one minute and 21 seconds in third.
Mexico's Del Toro, 21, would have clinched victory in his maiden Giro by successfully negotiating the Colle delle Finestre, the highest point of this year's race and where Yates' hopes of winning evaporated in 2018.
But Yates, 32, exorcised those ghosts as he attacked on the brutal ascent to leave Del Toro, who had held the race lead since stage nine, and Carapaz in his wake.
He not only wiped out Del Toro's advantage but was one minute 41 seconds clear of his general classification rivals when he crested.
His Visma-Lease A Bike team had pulled off a masterstroke as team-mate Wout van Aert was in the breakaway group and allowed Yates to catch him on the descent, helping him build a comprehensive lead over the final 20km.
Jayco-Alula's Australian rider Chris Harper, who was the first over the Colle delle Finestre summit, claimed the second Grand Tour stage win of his career, with Yates crossing one minute 57 seconds later, third on the day.
Yates was in tears as he hugged team staff at the finish, surrounded by media, with Del Toro of UAE Team Emirates crossing the line five minutes after him.
It means the Briton leads Del Toro by three minutes 56 seconds, with Carapaz in third, heading in to Sunday's processional stage in Rome.
"I'm not really an emotional person but I couldn't hold back the tears," said Yates.
"It's something I've worked towards year after year and I've had a lot of setbacks but I've finally managed to pull if off."
Yates lost 30 seconds to Del Toro during Friday's stage but recovered to become just the third British rider to win the Giro, after Chris Froome (2018) and Tao Geoghegan Hart (2020).
Froome memorably snatched the pink jersey on the penultimate mountain stage in 2018, as Yates cracked and ultimately lost more than 38 minutes.
This year, the same climb was scheduled for late in the 205km stage from Verres to Sestriere and Yates, who bounced back from the 2018 Giro to win that year's Vuelta a Espana, said after today's stage he "always had it in the back of my mind" once the route was announced.
The 18.5km climb has an average gradient of 9.2% and started 43km from the finish.
Within a kilometre of the climb, Carapaz's EF Education team attacked, but Del Toro was alert to the danger and soon closed the gap to Carapaz, with the rest of the peloton dropping back.
Yet Yates then came from nowhere to join his general classification rivals and made a series of attacks before ultimately breaking clear.
When Yates hit the gravel section, he extended his lead, while Del Toro and Carapaz - the 2019 Giro winner - continued to trade blows.
But by the time they also reached the summit, some 2,178m above sea level - they knew the race was gone and Yates would be wearing the pink jersey for the first time since Froome took it from him in 2018.
"It's incredible, said Van Aert. "It was such a brave effort from Simon to go all in from so far. I love it when people are not racing for a place of honour."
Chris Harper (Aus/Jayco-Alula) 5hrs 27mins 29secs
Alessandro Verre (Ita/Arkea-B&B Hotels) +1min 49secs
Simon Yates (GB/Visma-Lease A Bike) +1min 57secs
Gianmarco Garofoli (Ita/Soudal Quick-Step) +3mins 52secs
Remy Rochas (Fra/Groupama-FDJ) +3mins 57secs
Martin Marcellusi (Ita/VF Group–Bardiani–CSF–Faizane) +4mins 31secs
Carlos Verona (Spa/Lidl-Trek) Same time
Max Poole (GB/Team Picnic PostNL) +6mins 45secs
Isaac del Toro (Mex/UAE Team Emirates-XRG) +7mins 10secs
Giulio Pellizzari (Ita/Red Bull-Bora-Hansgrohe) Same time
Simon Yates (GB/Visma-Lease A Bike) 79hrs 18mins 42secs
Isaac del Toro (Mex/UAE Team Emirates-XRG) +3mins 56secs
Richard Carapaz (Ecu/EF Education-EasyPost) +4mins 43secs
Derek Gee (Can/Israel-Premier Tech) +6mins 23secs
Damiano Caruso (Ita/Bahrain Victorious) +7mins 32secs
Giulio Pellizzari (Ita/Red Bull-Bora-Hansgrohe) +9mins 28secs
Egan Bernal (Col/Ineos Grenadiers) +12mins 42secs
Einer Rubio (Col/Movistar) +13mins 5secs
Brandon McNulty (US/UAE Team Emirates-XRG) +13mins 36secs
Michael Storer (Aus/Tudor Pro Cycling) +14mins 27secs