The U.S. will finish second or third and meet Russia or Finland in a quarterfinal on Thursday.
In Stockholm, the other group leader, Switzerland, defeated Belarus 4-1 to achieve its best group record at the worlds, seven wins and no losses. The Swiss hope to medal for the first time since 1953, when they were third among three teams.
Julian Walker scored twice, and Roman Josi and Mathias Bieber once each.
Switzerland was followed by Canada and Sweden. Norway and the Czech Republic are vying for the last quarterfinal spot.
Slovakia's Branko Radivojevic was handed a gift goal just 15 seconds into the game when U.S. goaltender Ben Bishop turned the puck over, trying to reach a teammate with a pass.
Martin Bartek scored 3:44 in, and Rene Vydareny made it 3-0. Danny Kristo replied for the U.S. in the second period, and Slovakia's Marko Dano added a late empty-net goal.
More Sports Headlines
Cowboys’ Romo likely to miss 2 months with broken collarbone Community sports: Bulletin board Carroll not concerned with Seahawks’ 0-2 start Huskies' freshman QB Browning looks comfortable, confident Mariners' reliever Farquhar bounces back Report: Bears QB Cutler could miss at least two games Defense leads Jets to 20-7 victory over Colts Huskies' backup QB Lindquist has ‘unique role’
Our new comment system is not supported in IE 7. Please upgrade your browser here.