SOCHI -- A dangling and dazzling Phil Kessel helped the United States clinch an automatic bye into the quarterfinals 24 hours after the Americans grabbed the attention of the sports world in dramatic fashion.

Kessel produced the first hat trick by an American player in the Olympics since John LeClair in 2002 to lift the U.S. to a 5-1 victory against Slovenia at Shayba Arena, the venue across the street from Bolshoy Ice Dome, where on Saturday T.J. Oshie put his quick hands on display to lift the U.S. to a 3-2 shootout win against Russia.

The U.S. finished with eight of a possible nine points to win Group A at the 2014 Sochi Olympics. It now waits to find out which nation it will face in the quarterfinals on Wednesday.

The Slovenians finished third in Group A with three points and eighth in the preliminary round thanks to their seminal win against Slovakia on Saturday, the nation's first Olympic victory in men's hockey. They will play Austria in the qualification round on Tuesday.

However Anze Kopitar, Slovenia's only NHL player, did not finish the game for unspecified reasons. The Los Angeles Kings center played only 16 shifts totaling 11:31.

Kessel scored twice within the first 4:33 of the game to give the Americans a 2-0 cushion. He completed his hat trick 11:05 into the second period, and Ryan McDonagh scored 72 seconds later to put any comeback plans Slovenia might have had to rest. David Backes added a goal 3:26 into the third period.

Kessel now leads the tournament with seven points (four goals, three assists). Joe Pavelski assisted on all of Kessel's goals.

Ryan Miller, who was the backup to Jonathan Quick in the Americans' first two games of the tournament, finished with 17 saves but lost the shutout bid with 17.6 seconds left in his first Olympic action since the gold-medal game in the 2010 Vancouver Olympics.

Quick didn't even dress for the game Sunday; Jimmy Howard, who was a healthy scratch for the previous two games, served as Miller's backup against Slovenia.

The Americans also scratched Max Pacioretty in favor of Derek Stepan. Pacioretty averaged 10 minutes of ice time and had an assist in the first two games.

Kessel opened the scoring 64 seconds into the game with a gorgeous goal. He took a pass from Pavelski in stride, dangled his way around Slovenia defenseman Mitja Robar and slid a shot through goalie Luka Gracnar's pads.

He made it 2-0 when he batted Pavelski's airlifted pass into the net at 4:33 of the first period.

However the Slovenians were undeterred by the early deficit. They pressured the Americans and generated some quality scoring chances on Miller, who had to come up with seven saves in the first period.

The early lead also might have taken some of the emotion away from the U.S., which didn't seem as engaged in the game during the final 15 minutes of the first period and the first 10 minutes of the second.

It took a quality shift by the fourth line, featuring Oshie, Blake Wheeler and Paul Stastny, for the U.S. to finally pin the Slovenians in their defensive zone for an extended period of time.

Kessel, Pavelski and James van Riemsdyk came out for the following shift and quickly made it 3-0. Gracnar stopped Pavelski's point shot with his right pad but Kessel beat Robar to the rebound and put it into the open left side of the net.

McDonagh wired a shot from the right circle into the top right corner 1:12 later to give the U.S. a 4-0 lead. Wheeler, who played 38 seconds and had a minor penalty in the win against Russia, found McDonagh in the right circle with a pass out of the left corner.