The United States shut out Denmark 3-0 on Saturday to stay perfect at the ice hockey world championship, while Switzerland rallied from a goal behind to top Canada 3-2 in a clash of undefeated teams.

Tyler Toffoli put Canada ahead midway through the second period on a power play, but the Swiss answered with goals from Nico Hischier and Dario Simon in the frame.

Andres Ambuhl stretched the advantage to two in the final period. Michael Carcone deflected in a slap shot by Brad Hunt for Canada to reduce the lead to one with 3:38 to go. Canada pulled goaltender Samuel Montembeault for an extra attacker, but the Swiss held firm.

The Americans lead Group A with 15 points and have secured a spot in the quarterfinals, while Switzerland leads Group B with five wins from five games. The top four teams from the two eight-team groups advance to the knockout stage.

In the Latvian capital of Riga, the Czech Republic beat Norway 2-0 to earn a spot in the final eight. Dominik Kubalik scored the opening goal with a slap shot on a power play for the Czechs to lead the scoring table with seven goals.

In Tampere, defending champion Finland defeated Austria 3-1 for the third straight victory and Sweden scored all of its goals in the opening period in shutting out France 4-0.

Sweden is second in Group A, a point behind the U.S., and Finland is another point back. They have qualified for the next stage.

In Riga, co-host Latvia demolished Kazakhstan 7-0 in Group B to stay in contention for a quarterfinal spot.

The Associated Press contributed to this report.