KOSICE, Slovakia -- The Brits will be back.
Ben Davis scored 2:03 into overtime for Great Britain to complete an unlikely comeback and edge France 4-3 to avoid relegation at the expense of the French at the ice hockey world championship on Monday.
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.
The British fought back with a couple of goals from Robert Dowd and Mike Hammond in the second frame. Robert Farmer tied it in the final frame, forcing overtime.
Great Britain will now get to compete at next year's worlds in Switzerland.
In Group B, Dennis Rasmussen scored the winner into an empty net with 34 seconds remaining for Sweden to beat Latvia 5-4.
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.
Elias Pettersson, Adrian Kempe, Anton Lander and Patric Hornqvist had a goal each for the Swedes. William Nylander had two assists to lead the scoring table with 15 points.
Canada plays Denmark in Group A later Monday, while Austria faces Italy in another relegation match in Group B.
Information from The Associated Press was used in this report.