Forward Alex Formenton (Ottawa Senators) scored into an empty net 26 seconds later after a pass from Victor Mete (Montreal Canadiens).
"I think everyone worked hard, did their job and did their role, and I don't think if anyone did their job it would have been the same outcome, but everyone did their part and it resulted in our favor," Mete said.
Carter Hart (Philadelphia Flyers) made 35 saves to help give Canada its 17th gold medal and first since the 2015 tournament in Toronto and Montreal. Hart made up for the sadness he felt after the 2017 tournament when Canada lost 5-4 in a shootout to the United States in the gold-medal game.
"It's a bit surreal and it's amazing," Hart said. "It's only been a year now since last year's tournament. Last year was very disappointing. The seven returning players are really lucky to get another opportunity at this."
Canada captain Dillon Dube (Calgary Flames) made it 1-0 at 1:19 of the second period. Dube received a pass from Jordan Kyrou (St. Louis Blues) and beat Gustavsson over the shoulder. Gustavsson made 25 saves.
"They took it to us at the start," Dube said. "Once we settled down a little, we got more comfortable. It was nice to finish it off at the end and not have to go to overtime. It was unbelievable."
Sweden tied it 1-1 on a shorthanded goal by forward Tim Soderlund (Chicago Blackhawks). Soderlund received a pass from forward Linus Lindstrom (Flames) and beat Hart off the post.
"We're very disappointed. I think we played our best game in the tournament and we talked about it before," Sweden coach Tomas Monten said. "You need to do the best game last and I think we did. We didn't score as much as we needed to win [but] I'm proud of my boys. Everyone left everything out there and they gave it their all, but today wasn't enough."
Sweden has received a silver medal in three of the past six tournaments. They took back-to-back silver medals in 2013 after a loss to the United States, and 2014 after a loss to Finland. Their last gold medal came in 2012, when they defeated Russia 1-0 in overtime.
"It's all about honor and pride," Sweden defenseman Timothy Liljegren (Toronto Maple Leafs) said. "You put the Three Crowns on, you just want to go out there, play 100 percent, show all the fans in Sweden watching that we're a good hockey team. Certainly feels disappointing."
United States forward Casey Mittelstadt (Buffalo Sabres) was named MVP of the tournament. Mittelstadt (four goals, seven assists) and Czech Republic forward Martin Necas (Carolina Hurricanes; three goals, eight assists) each had 11 points and were the top scorers.
Mittelstadt was named to the All-Tournament Team along with teammate Kieffer Bellows (New York Islanders), Czech Republic forward Filip Zadina (2018 Draft eligible), Canada defenseman Cale Makar (Avalanche), and Sweden defenseman Rasmus Dahlin (2018 eligible) and Gustavsson.