MINSK, Latvia — Zemgus Girgensons squeezed the puck between the pads of veteran goaltender Tim Thomas to break a 4-4 tie in the third period and Latvia defeated the United States, 6-5, at the ice hockey world championship Thursday. It was the American’s second straight loss to Latvia.

The Buffalo Sabres’ Girgensons, a forward on the team coached by Ted Nolan, scored with 5:25 left to play in regulation time. Herberts Vasiljevs made it 6-4 with the winning goal with 2:21 left in the final period.

Brock Nelson’s second goal for the U.S. with 1:30 remaining in regulation was too late.

“It was an up and down game, we went up there, they went up there,” Girgensons said. “But we have to stop taking so many penalties. A lot of them were our own fault.”

Latvia goalie Kristers Gudlevskis made 31 saves, while Thomas stopped 19 shots.

Latvia was second in Group B to Russia. The U.S. was fourth.

Goals from Gints Meija, Mikelis Redhlins and Aleksandrs Nizivijs gave Latvia 3-1 lead but Nelson and Tyler Johnson scored on power-plays to tie it up in the second period.

“Six goals is just too many” to concede, U.S. defenseman Seth Jones said. “We are doing a lot of good things but have to tighten up defensively. We can’t let teams get too close to the net.”

Elsewhere, another Sabre, Cody Hodgson, had a hat trick and Matt Read scored twice to lead Canada’s 6-1 rout of Denmark.

“There was a good chemistry today and it’s nice to contribute,” Hodgson said. “I’m just feeling more comfortable.”

Hodgson said the group stage was just a warmup for the playoffs. Canada, with three wins out of four, was in a race with unbeaten Sweden to win their eight-team Group A.