TORONTO -- World junior gold belongs to Canada once again after a classic victory over Russia.

Canada came perilously close to blowing a four-goal lead and hung on through an intense third period to beat Russia 5-4 on home ice at Air Canada Centre on Monday night.

"There were some tense moments... That was one of the craziest games I've ever been a part of," said defeceman Josh Morrissey.

The win ended Canada's gold-medal drought that dated to 2009. It's the nation's first medal in this tournament since 2012.

"That was a once in a lifetime opportunity and we took advantage of it, " said Max Domi about winning on home ice.

Canada scored on its first shift, chased Russia's starting goaltender less than three minutes in and ignited the red-and-white-filled crowd of 19,014 that began to celebrate in the second period. When Russia chipped away, Canada's veteran bunch found its first trouble of the tournament but survived to avoid what would've been one of the more memorable collapses in history.

Anthony Duclair, Nick Paul, Connor McDavid, Domi and Sam Reinhart scored for Canada to build the lead, which at its height was 5-1. Dmitri Yudin, Ivan Barbashev, Sergey Tolchinsky and Nikolai Goldobin scored for Russia, which wasted little time chipping away.

"Preparing for this game I almost felt like I played in it before," said Canadian captain Curtis Lazar. "Everyone did their part, no one stood out any further than others."

Zach Fucale finished with 26 saves, enough to get the job done with Canada clinging to a 5-4 lead. His two biggest saves may have come with 12 and four seconds left as Russia was playing with the extra attacker.

Russia's Ilya Shestyorkin got the hook after giving up two goals on the only two shots he faced. Backup Ilya Sorokin came in and allowed three on 19 shots.

The gold medal is Canada's 16th since the tournament began in 1977.

Prime Minister Stephen Harper was in attendance for what felt like more than just a hockey game, even a tournament final. The tense rivalry dates to the 1972 Summit Series, and the last time these teams met for world junior gold, Canada blew a 3-0 third-period lead and lost 5-3 in Buffalo, N.Y., in 2011.

"They have such a skilled program,"Lazar said of the Russians. "They know how to put the puck in the net with their firepower and they love spoiling Canada's parade and beating them every which way."

Russia tried to beat Canada up the second the puck dropped at centre ice. Pavel Buchnevich and Domi had been jostling before the faceoff, and Buchnevich decked Domi the instant he could.

But Domi turned down the ice and at the 23-second mark and fed Duclair for the game's first goal on Canada's first shot. Not long after, 2:32 in, Brayden Point found Paul driving to the net and it was 2-0 Canada on just two shots.

With the Russians stunned and down two goals so early, coach Valeri Bragin yanked Shestyorkin in favour of Sorokin, who beat Canada in exhibition action last month in the same building.

Duclair hit the post with a chance to score his second of the night, but then Sorokin seemed to stabilize the Russians, who got their legs under them and began to pressure Canada. At 9:20, Yudin shot the puck through traffic and had it clank off iron and in past Fucale to keep it a game.

As soon as the goal was scored, Russia's Alexander Sharov decked Canada's Nick Ritchie and pushing and shoving followed. Linesmen had to block off Canada's bench from the Russians as they celebrated to keep things from escalating.

Russia kept Canada on its heels until McDavid provided some temporary breathing room 5:08 into the second. Morrissey sprung him on a breakaway, and the 17-year-old phenom slid the puck five-hole on Sorokin to make it 3-1.

Domi added his fifth goal of the tournament at 7:22 when he got space down the left wing and patiently waited before picking a corner glove side. That forced a Russian timeout with the score 4-1.

Chants of "This is our house" filled Air Canada Centre a few minutes later, and then at 12:30 fans thought they were close to tasting gold. That's when Reinhart got his stick on Domi's shot and redirected it in to give Canada a four-goal lead.

Things began to unravel when Jake Virtanen was penalized for boarding Sharov. On the power play, Barbashev poked the puck in from the side of the crease to cut it to 5-2.

Unbelievably 32 seconds later it was 5-3 when Tolchinsky scored on a two-on-one on a pass from Goldobin. Worry began to creep in with Russia rolling.

Defenceman Samuel Morin took a tripping penalty, and at 17:37 Goldobin scored to make it a one-goal game. That prompted Canadian coach Benoit Groulx to use his timeout and settle down his rattled team.

Canada had enjoyed a charmed trip to the gold-medal game, never trailing and barely playing in stressful situations. Groulx hoped going through a tough first period against Slovakia in the semifinal would provide his group with some kind of adversity to draw from.

That paled in comparison to Monday night, when Canada was forced to cling to a one-goal lead. Reinhart took a hooking penalty late in the second to give Russia a power play to start the third, and though there were some nervous moments it ended without much of a threat.

Sorokin made a pad save in the third to keep Canada from feeling too good about itself. But the Russians couldn't score the fifth goal to complete the comeback.

Notes -- Bronze-medal-winning Slovak goaltender Denis Godla was voted tournament MVP by members of the media. Godla stopped 224 of the 242 shots he faced in seven games. ... Joining Godla on the all-tournament team were McDavid, Domi, Reinhart, Morrissey and Swedish defenceman Gustav Forsling. ... The 50/50 draw was a new arena record of $90,150