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
Seahawks RB Lynch out multiple weeks after abdominal surgery 3:58 p.m. No. 10 Gonzaga rolls past Washington 80-64 in Bahamas 12:44 p.m. NHL’s Canadiens sign GM Bergevin to extension 1:06 p.m. Late Frank Gifford suffered from degenerative brain disease 1:04 p.m. Rams WR Bailey critical after being shot in Florida 1:02 p.m. NBA’s Hornets agree to multiyear extension with CliffordAP Photo NCCB106 12:59 p.m. Syracuse University’s appeal of basketball sanctions rewarded 12:57 p.m. Source: Rams' Bailey in critical condition after shooting
Our new comment system is not supported in IE 7. Please upgrade your browser here.