Mika Zibanejad scored a pair of goals as Sweden finished pre-tournament play for the upcoming IIHF world junior hockey championships by holding on for a 5-3 victory over Canada.
Rickard Rakell, Filip Forsberg and Johan Larsson also scored for the Swedish team, which improved to 2-0.
Mark Stone, Brendan Gallagher and Jaden Schwartz replied for Canada, which went 2-1 in exhibition action.
"I thought we deserved better," said Canada forward Devante Smith-Pelly. "We had a 10-minute lapse that cost us. You can't let down at all or it will cost you the game as was shown tonight. We have to tighten up a bit, but I feel we are getting there. We didn't show any quit."
Also Friday, the United States blanked Slovakia 5-0.
The Canadian squad feels the loss serves as a lesson of what it will take to be successful at a world juniors.
"With Canada's success in the past I think some people expect us to win every game," said defenceman Dougie Hamilton. "That's not the case. A lot of the teams are very good and we have to work for our wins. This just shows that. It's an eye-opener for us and we are going to have to get better for our first game."
Swedish goalie Johan Gustafsson said he hopes the performance is a sign of things to come for his team in the tournament.
"It was a good way to go into the tournament for us," he said. "We wanted to have some momentum heading into the tournament. We battled really hard all game long."
However, Swedish coach Roger Ronnberg said his team learned some lessons as well.
"I was really happy with the way we played the first 20 minutes but then I think we lost the momentum," he said. "They were out-chancing us at the end of the game. We won the game, but I can't be too happy because we have a lot of things to work on."
Canada started the scoring 11 minutes into the opening period as Stone showed some quality stick-handling, deking Gustafsson and sliding in the puck on the backhand while charging hard to the net.
Sweden came close to tying the game with six minutes to play in the first as a high shot on goalie Mark Visentin landed in the crease behind him and sat there momentarily before Canadian defender Scott Harrington swept it to safety.
Sweden did make it a 1-1 game with two minutes to play in the first as William Karlsson intercepted a pass in the Canadian zone and fed it to Rakell who beat Visentin with a quick wrist shot.
That goal opened the floodgates, as Sweden would go ahead 3-1 on two more quick goals.
With 1:13 remaining in the first, Erik Thorell dug a rebound away from Visentin and sent it in front to Forsberg who had an empty net to deposit the puck into.
Then, with 23 seconds left, Zibanejad rifled in a shot from the top of the left circle to leave the Canadian team reeling after 20 minutes.
Things didn't get much better for the Canadian side to start the second as the Swedes scored a power-play goal three minutes into the second when a long shot by John Klingberg was tipped by Larsson and dribbled through Visentin's legs.
Canadian head coach Don Hay pulled Visentin halfway through the game after allowing four goals on 17 shots, and put out Scott Wedgewood in his place.
Canada came close right after the switch on a terrific opportunity for Boone Jenner but Gustafsson made a clutch save.
Canada clawed to within two goals with three minutes to play in the second as Gallagher showed some deft hands by batting the rebound of a Brandon Gormley power play shot out of mid-air with a backhand and into the net to make it 4-2.
The Canadian squad pulled to within a goal just under three minutes into the third as captain Schwartz broke loose for a short-handed breakaway and buried his shot stick-side on Gustafsson.
Canada had the bulk of the chances for the remainder of the third but Gustafsson proved up to the challenge to hang on for the win with Zibanejad scoring his second of the game into an empty net with 24 seconds remaining.
"Hopefully this is going to help us move ahead and get better," said Hay. "This was a very intense Swedish team. We'll get better because of this game. You always learn the tempo and the pace as the tournament goes on and we need to get better as we move ahead."
Both teams will officially start the tournament on Dec. 26. Canada is in Pool B along with the Czech Republic, Denmark, Finland and the United States and will play its round-robin games in Edmonton. Sweden is in Pool A, along with Russia, Latvia, Slovakia, and Switzerland, playing its games in Calgary.
At Three Hills, Alta., Charlie Coyle scored twice as the U.S. beat Slovakia in Friday's other pre-tournament game.
Brandon Saad, Jason Zuker and Jared Tinordi also scored for the U.S., while Jack Campbell and Andy Iles combined for 18 saves.
Juraj Simboch made 31 saves for Slovakia.
Notes: Canada was introduced to the Edmonton public during a special ceremony at city hall on Friday afternoon. … Edmonton fans got their first look at Swedish defenceman Oscar Klefbom in the game. Klefbom was a first round selection of the Oilers, 19th overall, in the 2011 NHL Entry Draft. … Canada has medalled at thirteen consecutive IIHF world junior championships, including gold medal performances in 2005, 2006, 2007, 2008 and 2009, silver medals in 1999, 2002, 2003, 2004, 2010 and 2011 and bronze medals in 2000 and 2001.