ST. PETERSBURG, Russia (AP) Finland was the only unbeaten team left in the ice hockey world championship after routing Canada 4-0.
Canada, like Finland, won all six of its games going into the group decider, and conceded just four goals.
In what was effectively a tuneup between two teams already quarterfinal bound, the shot count was 21-19 to Canada as Finland's Mikko Koskinen made the difference in net.
Finland finished top of Group B, setting up a quarterfinal against Denmark, which made the playoffs only once before, while Canada must face Sweden in a rematch of the 2014 Olympic final.
Sweden lost to host side Russia 4-1. Russia meets Germany in the quarters. There was a goal and assist from Artemi Panarin, while Pavel Datsyuk, who is considering retirement from the NHL, also finished earned a goal and assist.
Earlier, the Czech Republic topped Group A by beating a flattered Switzerland 5-4.
Switzerland needed to win to advance. Instead, Denmark's spot in the quarterfinals was confirmed.
The Czechs, seeking their first title since 2010, learned they will play the United States in the quarters, even though the Americans lost their last group game to Slovakia 3-2 in overtime.
Slovakia would have qualified instead of the Americans with a win in regulation, but the U.S. earned a point for forcing overtime, enough to secure fourth place in Group B.
Germany also advanced from the group.
Also advancing from Group A were Russia, Sweden, and Denmark.
Switzerland, thoroughly dominated by the Czech Republic, fought back from 3-1 down early in the third then 5-2, with a pair of late goals.
Slovakia took the lead against the U.S. on a first-period wrist shot from Christian Jaros, but forward Brock Nelson tied it up off a pass from David Warsofsky.
Nick Foligno put the U.S. in front 2-1 early in the third but Pavol Skalicky turned Tomas Marcinko's shot into the net to make it 2-2. Slovakia pulled goaltender Julius Hudacek in an attempt to win the game in regulation and take the Americans' quarterfinal place, but the U.S. held on.
Marko Dano scored the game-winning goal for Slovakia as both teams finished the preliminary round with 3-4 records.
Kazakhstan and Hungary will be relegated from the top level of the world championship for next season. The Kazakhs' relegation was assured last Saturday, while Hungary was condemned on Tuesday following Belarus' 3-0 win over France.