Dennis Rassmusen scored the winner into an empty net with 34 seconds remaining for Sweden to beat Latvia 5-4 at the ice hockey world championship on Monday.

Latvia needed a win in regulation to keep alive hopes for a quarterfinal spot in the Group B game in Bratislava. After Roberts Bukarts tied the game for Latvia at 4-all with 3:24 remaining in the final period to complete his hat trick, the Latvians pulled the goaltender for an extra attacker.

Latvia’s loss confirmed the four quarterfinalists from Group B: Leader Russia, the two-time defending champion Swedes and the Czech Republic, and Switzerland.

Latvia's Rudolfs Balcers, left, checks Sweden's Jesper Bratt during the Ice Hockey World Championships group B match between Sweden and Latvia at the Ondrej Nepela Arena in Bratislava, Slovakia, Monday, May 20, 2019. (AP Photo/Ronald Zak)
Latvia’s Rudolfs Balcers, left, checks Sweden’s Jesper Bratt during the Ice Hockey World Championships group B match between Sweden and Latvia at the Ondrej Nepela Arena in Bratislava, Slovakia, Monday, May 20, 2019. (AP Photo/Ronald Zak)

Elias Pettersson, Adrian Kempe, Anton Lander and Hornqvist had a goal each for the Swedes. William Nylander had two assists to lead the scoring table with 15 points.

In Group A in Kosice, Ben Davis scored 2:03 into overtime for Britain to complete an unlikely comeback and edge France 4-3 to avoid relegation at the expense of the French.

Britain’s return to the top division after 25 years looked short-lived after it was defeated in its previous six group games and was 3-0 down in the middle period.

Latvia's Roberts Bukarts celebrates after scoring during the Ice Hockey World Championships group B match between Sweden and Latvia at the Ondrej Nepela Arena in Bratislava, Slovakia, Monday, May 20, 2019. (AP Photo/Ronald Zak)
Latvia’s Roberts Bukarts celebrates after scoring during the Ice Hockey World Championships group B match between Sweden and Latvia at the Ondrej Nepela Arena in Bratislava, Slovakia, Monday, May 20, 2019. (AP Photo/Ronald Zak)

The British fought back with a couple of goals from Robert Dowd and Mike Hammond still in the second frame. Robert Farmer tied it in the final frame, forcing overtime.

Canada plays Denmark in Group A later Monday, while Austria faces Italy in another relegation match on Group B.

___

Players of Great Britain celebrate after winning the Ice Hockey World Championships group A match between France and Great Britain at the Steel Arena in Kosice, Slovakia, Monday, May 20, 2019. (AP Photo/Petr David Josek)
Players of Great Britain celebrate after winning the Ice Hockey World Championships group A match between France and Great Britain at the Steel Arena in Kosice, Slovakia, Monday, May 20, 2019. (AP Photo/Petr David Josek)
Players of France after loosing the Ice Hockey World Championships group A match between France and Great Britain at the Steel Arena in Kosice, Slovakia, Monday, May 20, 2019. (AP Photo/Petr David Josek)
Players of France after loosing the Ice Hockey World Championships group A match between France and Great Britain at the Steel Arena in Kosice, Slovakia, Monday, May 20, 2019. (AP Photo/Petr David Josek)
Great Britain's Ben Davies, right, celebrates with teammates Mark Richardson, center, and Jonathan Phillips, left, after scoring his sides winning goal during the Ice Hockey World Championships group A match between France and Great Britain at the Steel Arena in Kosice, Slovakia, Monday, May 20, 2019. (AP Photo/Petr David Josek)
Great Britain’s Ben Davies, right, celebrates with teammates Mark Richardson, center, and Jonathan Phillips, left, after scoring his sides winning goal during the Ice Hockey World Championships group A match between France and Great Britain at the Steel Arena in Kosice, Slovakia, Monday, May 20, 2019. (AP Photo/Petr David Josek)