Belgian Thomas De Gendt climbed to a solo stage win and fourth place overall behind leader Joaquim Rodriguez thanks to a spectacular 57-kilometre mountain breakaway on Saturday.
Canada's Ryder Hesjedal lost time but remained the big favourite to clinch overall victory when the race ends on Sunday in Milan.
De Gendt charged away from the favourites just before the top of the infamous Mortirolo climb, then shed riders from an earlier break to claim a summit stage win on the snow-capped 22-kilometre ascent of the Passo Dello Stelvio.
Italian Damiano Cunego, the Giro 2004 winner, finished 56 seconds behind the 25-year-old Vancansoleil rider on the toughest and final mountain stage of this year's race, with Spain's Mikel Nieve third and Rodríguez fourth.
"I thought that if the favourites didn't start chasing soon, the pink jersey (of leader)]was a possibility as well as the stage" De Gendt, who moved from eighth to fourth thanks to his attack, told reporters.
"But I knew the other favourites would go full gas in the last four kilometres and eat into the margin I had built up.
"The podium in Milan is still a possibility, though, if I recover well enough from today's effort."
De Gendt revealed he had climbed the Passo Dello Stelvio pass 20 or 30 times as part of his training rides in the area, but that he had no idea his long-distance attack would gain him such a prestigious first Grand Tour stage win.
"I didn't expect to win, I went away on the Mortirolo because I just thought it was better to get some time on the favourites before the Stelvio," he told reporters.
""Then suddenly in the valley we had a big gap and all the pieces fell into place.
"The last 10 kilometres I was dying inside, but to win on my training mountain is fantastic."
Spaniard Rodríguez leads Hesjedal by 31 seconds with Italy's Michele Scarponi in third at 1:51 and De Gendt fourth at 2:18.
Hesjedal's Garmin-Barracuda team mate Christian Vande Velde of the U.S. rode at the head of the pack of favourites for three quarters of the Stelvio, but neither he nor Hesjedal could prevent Scarponi and Rodriguez from moving clear in the final kilometres.
Rodríguez gained 14 seconds on the Canadian to bolster his lead but said that with only Sunday's 30 kilometre time trial remaining, Hesjedal, a former national champion in the speciality, was the big favourite for the final victory.
"I don't think my advantage will be enough on Hesjedal," Rodríguez, who took over as points leader from Britain's Mark Cavendish, told reporters.
"But at least I've got a few more seconds on him , I'm a better time triallist than I was last year, and I'll try to ride the time trial of my life tomorrow. All I can do is dream."