HERNING, Denmark - After having trouble scoring at 5-on-5, Connor McDavid and the Canadians proved to be deadly at 3-on-3.

McDavid scored 46 seconds into overtime, batting his own rebound out of the air past Latvia goaltender Kristers Gudlevskis, as Canada edged Latvia 2-1 Monday and clinched a quarterfinal berth at the world hockey championship.

The combination of McDavid, Ryan Nugent-Hopkins and Aaron Ekblad dominated play at 3-on-3 in the overtime session as Canada got two much-needed points.

"Those guys are so deadly with the puck, especially with Connor's speed," said Canadian forward Ryan O'Reilly. "The way he beats the guy up the wall and creates a scoring chance and ends the game, it's definitely dangerous. That was huge, getting that goal."

Anthony Beauvillier opened the scoring for Canada 2:51 into the first period, staying with the play to shovel in a loose puck after Gudlevskis failed to completely freeze a tip in front of the net by Jean-Gabriel Pageau.

"I thought the play was dead, then I saw the puck behind his pads, so I was just trying to find it," said Beauvillier on his second goal of the tournament. "It was probably one of the easiest goals I've scored in my career."

Beauvillier skated on a line with Pageau and Mat Barzal as coach Bill Peters shuffled his units in an effort to spark more offence after a disappointing 5-1 loss to Finland on Saturday.

"I thought it was a mixed bag," said Peters about the changes. "We're still trying to find the right combinations. Tyson Jost went in there and played well — I thought that line (with Bo Horvat and Jordan Eberle) was good. I thought the Barzal line probably had their best game of the tournament.

"I thought those two lines were dangerous for us on a consistent basis. Now we've got to get contributions from others throughout the lineup."

After being outplayed and outshot 10-4 in the first period, the hardworking Latvians applied good pressure in the second. Close-checking at the defensive end of the ice, Latvia also drew two penalties and fired nine shots on goal in a scoreless middle frame.

"They played us really hard," said goaltender Darcy Kuemper. "They worked their butts off and didn't give up a whole lot."

Kuemper was sharp through two periods in his first start since Canada's tournament-opening 5-4 shootout loss to the United States on May 4, but was beaten 1:50 into the third on a Kristians Rubins point shot, Latvia's 14th of the game.

"I just picked it up a little bit late," Kuemper said. "(Rubins) shot it and I didn't have good eyes on it. I saw it last second, just got a piece of it and it snuck through."

Thomas Chabot, who was scratched to make room for Marc-Edouard Vlasic in Canada's loss to Finland, returned to the lineup on Monday to anchor the first power-play unit, while Ryan Pulock was scratched on defence.

In the late stages of the third, Canada turned up the aggression, jamming the net in front of Gudlevskis, who was making just his second start of the tournament after giving up eight goals to Finland on May 6. Canada outshot Latvia 9-2 in the third and 31-15 through regulation, but extra time was needed to decide the winner.

Forward Kyle Turris was added to Canada's roster after his Nashville Predators were eliminated from the Stanley Cup playoffs, but did not suit up on Monday. He could see action in Canada’s final round-robin game against Germany on Tuesday. Pierre-Luc Dubois did not dress against Latvia due to a lower-body injury. He's listed as day-to-day.

With Monday's win, Canada is guaranteed a top-four finish in Group B and a quarterfinal berth. Canada could finish anywhere from second to fourth in Group B, depending on the outcome against Germany and the results of Tuesday's two other games: Finland versus the United States and Denmark versus Latvia.

In Tuesday's late game in Herning, the hosts from Denmark will meet Latvia to determine the fourth quarterfinalist.

Norway beat South Korea 3-0 in Monday's other Group B game. Both teams had already been eliminated from playoff contention.

In Group A action in Copenhagen on Monday, Russia beat Slovakia 4-0 and the Czech Republic beat Austria 4-3.

Note to readers: This is a corrected story. A previous version had Kristians Rubins first name misspelled.

OPINION The end of a long weekend always feels like a breakup out of a movie. With two lovers parting ways from what has been an incredible adventure and Take my breath away playing in the background. They