Nibali attacked with under 2 miles left on the steep ascent to Tre Cime di Lavaredo, the three-week race's highest point at an altitude of 7,550 feet.
On the final stages of the climb, the road was surrounded by huge banks of snow.
An Italian with the Astana team, Nibali clocked 5 hours, 27 minutes, 41 seconds over the 131-mile leg, which began in Silandro and passed through Cortina d'Ampezzo.
Nibali also took the red points jersey from Mark Cavendish, but the British sprinter can reclaim it by winning the final stage.
The race ends on flat ground in Brescia on Sunday with a 122-mile stage starting in Riese Pio X.
Nibali earned his second stage victory, having won Thursday's mountain time trial.
The 19th stage Friday was canceled due to snow. The 20th stage was originally supposed to include a few more climbs, but the route was altered due to the adverse weather conditions and snow covering some roads.
Colombian pair Fabio Duarte and Rigoberto Uran finished second and third, 17 and 19 seconds behind, respectively.
Uran moved up from third to second overall, 4:43 behind Nibali. Cadel Evans, the 2011 Tour de France winner, dropped to third, 5:52 back.
Evans finished about 1 1/2 minutes behind Nibali in the stage, which was also characterized by sub-freezing temperatures. Nibali had to have hot tea poured over his hands to relieve the cold after crossing the line, so he could take off his wet gloves without pain.
Along the final climb, Nibali had to push fans away who kept clinging to him.
"I was worried one of them might slip," he said.
More Sports Headlines
Seattle Mariners fire general manager Jack Zduriencik UW’s Petersen returns to Boise roots 5:53 p.m. WSU offense has plenty of targets 5:51 p.m. M’s notebook: Struggling Zunino optioned to Tacoma 5:23 p.m. M’s plan to move quickly on new GM 5:19 p.m. The defending WHL U.S. Division-champion Silvertips open training camp Seahawks’ QB Wilson focused on football despite busy life White Sox beat Mariners 4-2
Our new comment system is not supported in IE 7. Please upgrade your browser here.