HERNING, Denmark — Cam Atkinson scored in overtime to give the United States a 3-2 win over Latvia on Thursday, its fourth straight victory at the ice hockey world championship.

In another tight game, Slovakia kept its hopes alive for a quarterfinal spot by topping France 3-1, with Michal Cajkovsky scoring the final goal into an empty net.

Atkinson scored his third goal in the tournament 1:23 into overtime on a power play

“It’s obviously nice to get that goal,” Atkinson said. “It wasn’t our prettiest by no means, got to give credit to them. They fought from the start all over to the end,” he said. “We took the points but we need to be a lot of better.”

Chris Kreider gave the U.S. a 1-0 lead when he knocked in a loose puck on a power play, but Latvia defenseman Uvis Balinskis ended goalie Keith Kinkaid’s bid for a third straight shutout with a deflected shot with 2:03 remaining in the first period.

Latvia then went ahead in the middle period through Andris Dzerins, but Colin White tied it for the U.S. with a slap shot that went between the pads of goalie Elvis Merzlikins.

Captain Patrick Kane and forward Alex DeBrincat finished with two assists.

Kinkaid made several key stops in the third period and finished with 17 saves in the game.

“I was just trying to keep my team even at 2-2 and they did the rest,” Kinkaid said. “It took the overtime period to do it but we’ve got the win.”

The U.S. jumped to the top of Group B with 10 points followed by Finland on nine. Canada is two points back and had a game in hand against Norway later Thursday. Latvia has six points.

Slovakia has seven points in fourth place of Group A in Copenhagen. Sweden tops that group with 12, followed by Russia and Switzerland on nine. Russia faced the Czech Republic later Thursday.