COLOGNE, Germany — Sweden won the ice hockey world championship with a 2-1 victory on penalties over two-time defending champion Canada on Sunday.

Sweden goaltender Henrik Lundqvist stopped three penalties and Ryan O’Reilly struck the post for Canada, as Nicklas Backstrom and Oliver Ekman-Larsson scored shootout goals for the Swedes to win their first title since 2013.

The game ended 1-1 after overtime.

Lundqvist and Canada counterpart Calvin Pickard, who saved William Nylander’s first penalty for Sweden, were outstanding in a game in which the Canadians narrowly outshot their opponents 43-42.

“This is how close it should be when you get to the final game,” Sweden head coach Rikard Gronborg said. “It’s a huge win for Swedish hockey.”

The respect between the sides was evident from the off as defenses held firm in the opening two periods.

advertisement | advertise on newsday

The breakthrough came against the odds, with Backstrom penalized for slashing, when Victor Hedman scored short-handed with 20.8 seconds left in the second period.

It was a strange goal from distance as the defenseman just lifted the puck and it somehow bounced in through Pickard’s legs. Joel Lundqvist’s presence may have distracted the Canadian goaltender.

“It was a fluke goal,” Swedish forward Marcus Kruger said.

Canada had enjoyed twice as many shots in the second period.

O’Reilly equalized when he scrambled the puck in off a rebound from Mitch Marner.

It was tense, and fans were left gasping as the action swung from end to end.

Nate MacKinnon missed a good chance to clinch the win for Canada on a power play before overtime, when both goaltenders maintained their exceptional form.

“I want to congratulate Sweden. They were an exceptional team, it was a lot of fun to play them,” said Canada coach Jon Cooper.

“If we were going to lose to somebody, I’m glad those guys won.”

Earlier, Nikita Kucherov sealed a 5-3 win for Russia in the bronze medal match against Finland.

advertisement | advertise on newsday

“It’s not the medal we wanted,” Russia head coach Oleg Znarok said.