Finland erased a three-goal deficit to beat Sweden 4-3 in overtime Sunday, a result that gets each of the archrivals into the quarterfinals of the men's hockey tournament at the Olympics.

The United States can wrap up the top seed by beating Germany later in the day. That would make Finland the second seed, the Russians third and Sweden fourth in the knockout round.

LIVE UPDATES: BEIJING OLYMPICS

Sweden and Finland getting to OT means Canada will almost certainly be seeded fifth and need to play in the qualification round Tuesday. Barring an extremely unlikely upset loss to China in the preliminary round finale, the hosts and Canada would face off again two days later.

Finland earned some extra rest with its third-period comeback. Teemu Hartikainen got the Finns on the board early in the third and Iiro Pakarinen scored twice in the final five minutes of regulation. Harri Pesonen scored the winner 2:01 into 3-on-3 OT.

Beijing Olympics Ice Hockey

Finland players celebrate after an overtime win against Sweden in a preliminary round men's hockey game at the 2022 Winter Olympics, Sunday, Feb. 13, 2022, in Beijing. (AP Photo/Matt Slocum)

Lucas Wallmark, Lukas Bengtsson and captain Anton Lander scored power-play goals for Sweden, which led 3-0 just past the midway point of the second. Finland outshot Sweden 16-3 after the second intermission.

Finland played most of the game without former NHL forward Markus Granlund, who was ejected for a match penalty for an illegal check to the head of Sweden defenseman Philip Holm and could be facing a suspension. 

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Earlier Sunday, Slovakia picked up its first victory of the tournament by beating Latvia 5-2. Juraj Slafkovsky, the 17-year-old forward who is projected to be a top-10 pick in the NHL draft this summer, scored his fourth goal.

Slafkovsky had scored all of Slovakia's goals in the first two games. Against Latvia, the team finally got production elsewhere with goals from former NHL defenseman Martin Marincin and forwards Peter Cehlarik and Peter Zuzin.

"A lot of other guys finally score, not just Juraj," former NHL forward Tomas Jurco said. "For the team it’s great that some other guys get on the board, and we’re happy that we won."

CLICK HERE TO GET THE FOX NEWS APP

Barring an extremely unlikely upset of Canada by host China, Latvia will be the 11th seed and is in line to play sixth-seeded Denmark in the qualification round Tuesday. Slovakia is expected to be seeded eighth or ninth, depending on other action, and appears likely to face defending silver medalist Germany in the qualification round.

"I believe that we can beat anybody if we just play our game and play like a team," said Slovakia coach Craig Ramsay, who spent 22 years as an NHL assistant. "The most important part is not individual hockey but team play. We have a great group, and when they play like a team, we look pretty good. When we play as individuals, well, we’re no better than anybody else."