Fredrik Pettersson scored the winner in the fourth round of the shootout in Stockholm to give Sweden a spot in the semifinals.
Canada's Eric Staal had to be helped off the ice after a knee-on-knee collision with Alex Edler n the first period and did not return.
Trailing 1-0, Nicklas Danielsson scored a pair of power-play goals in the third period to give the hosts a 2-1 lead. Canada's Claude Giroux tied the game just over a minute after Danielsson's second goal.
Steve Stamkos of the Tampa Bay Lightning scored a second-period power-play goal.
Mike Smith of the Phoenix Coyotes stopped 30 shots in the loss, while Jhonas Enroth of the Buffalo Sabres made 39 saves for the win.
Canada extended its run of quarter-final losses in this tournament to four straight years. Canada last advanced to the semifinals in 2009 en route to a silver medal under current Canadian head coach Lindy Ruff.