Tyler Steenbergen re-directed in Connor Timmins' pass to break a tie with 1:40 left and Canada beat Sweden 3-1 to win the world junior hockey championship Friday night.
With the mostly red-and-white, Maple Leaf-flag-waving crowd still celebrating, Alex Formenton then sealed Canada's 17th gold medal victory by scoring into an empty net 26 seconds later.
Canadian captain Dillon Dube also scored in a game Canada never trailed. Carter Hart stopped 35 shots, a year after he was in the net in a 5-4 shootout loss to the United States in the championship game.
Drake Batherson set up the decisive goal by forcing a turnover behind the Sweden net. From the left corner, Batherson fed Timmins just inside the blue line.
Timmins then fed a hard pass into the left circle, hitting Steenbergen, who swept the puck behind goalie Filip Gustavsson, who was set at top of this crease.
Tim Soderlund scored for the Swedes, who settled for winning their 11th silver medal. Sweden is 0-4 against Canada in the championship game, including consecutive losses in 2008 and '09.
Gustavsson stopped 25 shots.
Kieffer Bellows broke Jeremy Roenick's U.S. single-tournament record by scoring ninth goal in the Americans' 9-3 win over the Czech Republic in the bronze-medal game earlier in the day.
Trent Frederic scored four times and the earned a medal for a third straight year to mark the nation's longest streak in tournament history.
The U.S. also finished third in 2016, while upping its medal total to 11 (four gold, one silver and six bronze).
Two of the third-place finishes coming in Buffalo, where the tournament was also held in 2010-11.
It was essentially a home game for Canada, with much of the arena filled with fans who flocked across the border from southern Ontario.
A rendition of "O Canada'' could be heard being sung from the arena foyer 45 minutes before puck drop.
The Swedes were booed each time they took to the ice to open a period, and "Go, Canada Go!'' chants were prevalent.
Canada struck first on Dube's goal 1:49 into the second period.
Jordan Kyrou set up the play on the transition by driving up the middle, with Dube on his right wing. Entering the zone, Kyrou slipped a pass into the right circle to Dube, who found a crease between defencemen Timothy Liljegren and Rasmus Dahlin.
With Liljegren hanging on Dube's back, the Canadian captain snapped a hard shot that beat Gustavsson over the left shoulder.
It marked the first time in seven tournament games in which the Swedes trailed.
They rolled through the preliminary round by going 4-0 and out-scoring their opponents by a combined 20-7 margin.
Sweden then edged Slovakia 3-2 in the quarterfinal and then built a 4-0 third -period lead and hung on to beat the United States 4-2 in the seminfinal on Thursday.
The Swedes responded by capitalizing on their speed and play-making skills by scoring their tournament-leading fourth short-handed goal and third in two games.
With Lias Andersson serving an interference penalty, Linus Lindstrom burst up the ice and gained the Canadian zone and cut toward the middle to draw the defenceman toward him.
Lindstrom then dropped a no-look pass to Soderlund, who was at full speed along the right wing.
Cutting to the net alone, Soderlund banked a shot in off the near post.
Canada certainly had its chances in the third period by failing to capitalize on two power-play opportunities in the final 9:06.
The best chance came with just over five minutes left. Kyrou had the puck in the left circle and threaded a pass through the slot to a wide-open Taylor Raddysh, who redirected the pass off the right post.
Canada entered the game with a tournament-leading power play, which had gone 13 of 23.
Against Sweden, the Canadians went 0 for 6.
Parity had caught up to Canada over the past decade.
Since winning a tournament-record five consecutive titles from 2005-09, the Canadians have on won just one gold medal, in 2015 with Edmonton Oilers captain Connor McDavid on the team, three silvers and a bronze.
Last year, Canada lost the championship, and on native soil in Montreal, no less, in a 5-4 shootout to the United States.
Hart was the losing goalie last year in a game Canada squandered a 4-2 third-period lead.
Leading into the tournament, Canada coach Dominique Ducharme's message to his players was to be one step better in every aspect of their preparation and play.
Canada won the Group A standings with only one blemish, a 4-3 shootout loss to the United States in a game played in snowy and conditions at the NFL Buffalo Bills' New Era Field last week.
The Canadians had a goal disallowed 12:13 in when Gustavsson made the initial stop but had difficulty covering up the puck in his crease.
The puck came free and Dube swept in under the goalie, but the play was immediately waved off by referee Robin Cir, who ruled he had already blown his whistle.