ST. PETERSBURG, Russia (AP) Germany beat the United States 3-2 on a last-minute goal by Korbinian Holzer at the world ice hockey championship on Sunday, putting American qualification for the quarterfinals in doubt.

Anaheim Ducks defenseman Holzer hasn't scored for the last two seasons in the NHL, but he made no mistake with a perfectly positioned shot from the blue line to beat U.S. goaltender Mike Condon.

It was a bitter ending for a U.S. team which had dominated puck possession, recording 33 shots against 14 for the Germans.

The third defeat in six games leaves the U.S. fourth in Group B, one place behind Germany with one game remaining against fifth-placed Slovakia. The top four advance to the quarterfinals.

Germany took the lead on Patrick Hager's power-play goal in the first before Jake McCabe tied the game for the U.S., but Germany responded almost immediately with a goal for Christian Ehrhoff.

Auston Matthews' power-play goal early in the second made it 2-2, before Holzer won the game for Germany with half a minute remaining in the third.

In Moscow, Denmark beat the previously unbeaten Czech Republic 2-1 in a shootout. The Czechs remain top of Group A and are sure of a spot in the quarterfinals, but a win in regulation would have guaranteed a first-place finish and top seeding for the quarterfinals.

Tomas Plekanec scored the opening goal for the Czechs in the second, but Morten Madsen scored for Denmark early in the third on a power play caused by an unnecessary too many men penalty for the Czech Republic.

Denmark held on through overtime for the shootout despite being outshot 41-21 over the whole game. Michal Repik's missed second shot for the Czechs meant Nicklas Jensen could secure victory for Denmark on the next shot.

The Czech loss means that Group A leaders Canada and Finland are now the only unbeaten teams in the world championship.