Alex DeBrincat had a goal off assists from Patrick Kane and Jack Eichel to pull the Americans into a tie midway through the period in the Group A game, but they couldn't score again against Patrik Rybar.
Erik Cernak and Tomas Tatar put the Slovaks up 3-1 in the second period and Michal Kristof gave them a three-goal cushion in the third. Corey Schneider made 32 saves for the Americans. They will face France on Sunday.
In Bratislava in Group B, the Czech Republic beat Sweden 5-2. Jakub Vrana scored twice for the Czechs against the two-time defending champion Swedes. Patric Hornqvist and Oskar Lindblom scored in the second period to give Sweden a 2-1 lead. The Czech Republic responded with four straight goals, including one into an empty net after Henrik Lundqvist was pulled to add an extra skater.
Czech goaltender Patrik Bartosak kept the Swedes scoreless in two of three periods in his world championship debut. Earlier in Group A in Kosice, Kaapo Kakko scored twice, including an empty-net goal with 34 seconds left, to lift Finland to a 3-1 victory over Canada. Arttu Ilomaki had a tiebreaking goal early in the third period and Kevin Lankinen finished with 20 saves for the Finns.
Canada's Jonathan Marchessault tied the game midway through the first period and Matt Murray stopped 24 shots. The Canadians, who won the world championship in 2016 and 2015, opened the tournament a day after Hockey Canada and the Toronto Maple Leafs agreed to hold John Tavares out because of his oblique injury.
In the Group B opener in Bratislava, The Russians got off to a strong start with Evgeny Dadonov scoring twice and Nikita Kucherov adding one in a 5-2 victory over Norway. .