Canada defeated United States 3-0 to claim top spot in Group A of the IIHF Ice Hockey World Championship, while Russia's 7-4 win over Sweden meant they finished first in Group B.
Six matches on Tuesday concluded the group stage of the tournament in Slovakia.
The eight qualifiers for the quarter-finals – the top four teams in each group – were known, but final placings were up for grabs.
Canada's reward is a last-eight clash against Switzerland – who finished fourth in Group B – on Thursday, while Russia, who have a 100 per cent record after seven games, will take on USA in a mouth-watering tie.
Finland will play Sweden and Czech Republic face Germany in the other two quarter-final contests.
Canada made a fast start against USA with goals from Pierre-Luc Dubois and Kyle Turris in the first period setting them on their way.
Jared McCann of the Pittsburgh Penguins netted in the second to seal the win, while the impressive Matt Murray made 28 saves at the other end en route to a shutout.
They overhauled previous leaders Finland, who lost 4-2 to Germany, while hosts Slovakia ended their tournament on a high after beating Denmark in a shootout.
In Group B, Czech Republic won a lively encounter 5-4 against Switzerland and Latvia beat Norway 4-1 in a match between two teams who already knew they would be eliminated.