Unable to solve Sweden goaltender Henrik Lundqvist during the shootout, Canada had to settle for silver at the 2017 IIHF World Championship on Sunday, losing 2-1 in the gold medal final.

After regulation and a 20-minute overtime couldn’t solve the contest tied at 1-1, Lundqvist stopped three Canadian shooters in the best-of-five shootout, while Ryan O’Reilly – Canada’s goal scorer in the third period – hit the post. Sweden needed just two goals in the shootout, leaving Lundqvist to do the rest.

The loss halts Canada’s streak of IIHF worlds gold at two after lifting the trophy in 2015 and 2016, following a medal drought in the annual tournament dating back to 2009. The gold for Sweden is their first since 2013.

RELATED: Canada beats Russia in wild semifinal

Canada’s Alex Killorn (left, in red) against Sweden at the IIHF worlds final on May 21, 2017.

The gold medal game started much in the same way Canada’s semifinal victory over Russia did before a wild finish a day earlier. A fairly-even first period saw Sweden register 12 shots against Calvin Pickard in the Canadian net, while Lundqvist stopped all 10 pucks directed at the Swedish cage as the teams were scoreless through the first 20 minutes.

Shots on goal became lopsided midway through the second period when at one point Canada was outshooting Sweden 9-1. Nonetheless, there was no beating Lundqvist. Through 39 minutes without a goal for either team, Canada killed off three Sweden power plays and failed to score on its sole man advantage.

RELATED: Canada over Germany in quarters
RELATED: Canada through the round robin stage

With 43 seconds to go in the second, Nicklas Backstrom took a slashing penalty putting Canada on its second power play. A chance to go ahead turned disastrous for the Canadians when a neutral zone turnover by O’Reilly sent Sweden’s Joel Lundqvist on a partial breakaway. The puck eventually found its way to the blue line, where Victor Hedman sent a tricky bouncing puck toward the Canadian net, that somehow managed to go through Pickard’s pads to give Sweden a 1-0 lead heading into the third period.

Sweden players celebrate Victor Hedman’s goal against Canada at the IIHF worlds gold medal game on May 21, 2017.

Redemption arrived for O’Reilly early in the third when a high sticking penalty to Elias Lindholm sent Canada back on the power play. It took only 10 seconds for Canada to capitalize on the man advantage levelling the game 1-1, with O’Reilly popping in the rebound created by a Mitch Marner shot from the point. O’Reilly’s sixth goal of the tournament had a second assist from Nathan MacKinnon, his team leading 15th point at worlds from 10 games.

Canada had to be cautious late in the third when Mike Matheson picked up a tripping penalty with 3:18 to play in regulation. A disciplined penalty kill by Canada, with notable work by Marc-Edouard Vlasic, helped run the clock down before it was Sweden’s turn to pay a visit to the box.

With just six seconds left in the Sweden power play and 1:24 remaining in the third, the Swedes were called for too many men on the ice and assessed a minor penalty. Canada pressed late, but couldn’t solve Lundqvist as the teams headed to overtime.

Canada celebrates Ryan O’Reilly’s (sweater no. 90) third period goal in the IIHF worlds final on May 21, 2017.

Another tripping call against Canada, this time on Sean Couturier at 9:07 of overtime, gave Sweden the 5-on-4 advantage. Late in the power play William Nylander nearly ended the affair in Sweden’s favour but for a key block from Pickard. He stopped 41 of 42 Swedish shots on the night.

Lundqvist was equally up to the task of keeping his country in the game during the extra frame, making several good saves, including a quick blocker touch on a MacKinnon effort late in overtime, just prior to the shootout, making 42 saves.

The Swedish goalie was the hero in the best-of-five shootout, stopping MacKinnon, Brayden Point in the first two Canadian attempts, then forcing O’Reilly to strike the post before thwarting Mitch Marner.

Henrik Lundqvist of Sweden makes a stop against Canada in overtime at the IIHF worlds gold medal game on May 21, 2017.

Swedish goals in the shootout came from Nicklas Backstrom and Oliver Ekman-Larsson, with Pickard stopping Nylander, while Gabriel Landeskog missed the net altogether.

Canada – winning silver – suffered its second loss of the tournament in 10 games, the other came against Switzerland, a 3-2 overtime defeat during group play.

Russia won the bronze medal earlier in the day winning 5-3 at Finland’s expense.

The 2018 IIHF World Championship will take place in Denmark next year from May 4 to 20.