SOCHI, Russia — Phil Kessel scored two of his three goals in the opening five minutes and became the first U.S. player to record an Olympic hat trick in more than a decade, leading the Americans to a 5-1 win over Slovenia on Sunday.

The U.S. is undefeated through three games in the men’s hockey tournament at the Sochi Games and with Sunday’s win earned an automatic spot in the quarterfinals.

“The most important thing is getting the win,” Kessel said. “We just gotta keep improving and keep winning games.”

Kessel scored 1:04 after the puck dropped, removing any thought the Americans would have a hangover after their emotionally charged shootout win against Russia on Saturday. His third goal midway through the second period made him the first U.S. player to score a hat trick at the Olympics since John LeClair did it on Feb. 15, 2002, against Finland.

Slovenia’s Marcel Rodman scored with 17.6 seconds left in the game, denying U.S. goalie Ryan Miller a shutout. Miller made 17 saves in his Sochi debut.

“Yeah, I definitely had some nerves,” Miller said. “It was an important game to ensure that we’re at the top of our pool.”

With plenty of support at the other end of the rink, the 2010 silver medal winner didn’t need to worry.

Ryan McDonagh scored about a minute after Kessel’s third goal to put the Americans up 4-0. David Backes gave them a five-goal cushion early in the third.

Kessel is the first American to score four goals in the three-game preliminary round of the Olympic tournament since Bill Cleary and Roger Christian in 1960. Fittingly, the native of Madison, Wis., and his teammates were sporting throwback jerseys in the style Cleary and Christian wore at the games in Squaw Valley — “USA” from right shoulder to left hip.

Luka Gracnar made 23 saves for Slovenia, which plays in the qualification-playoff round Tuesday after beating Slovakia and losing to the U.S. and Russia.

Even if Slovenia doesn’t win another game, it has been a successful appearance for a country that earned a surprising spot in the Olympic hockey tournament for the first time.

Slovenia has just one NHL player, Anze Kopitar of the Los Angeles Kings, and he didn’t finish Sunday’s game with flu-like symptoms, according to his father and coach, Matjaz Kopitar.

“He don’t feel good, because he has something with the stomach,” Matjaz Kopitar said. “He didn’t feel well. He was without the power. Hopefully, he’s going to be better.”

Slovenia was also without another key player, forward Sabahudin Kovacevic, who was suspended for one game for swinging his left elbow and landing it on the head of Slovakia’s Tomas Kopecky.

CANADA 2, FINLAND 1: Drew Doughty scored with 2:28 left in overtime to lift Canada over Finland on Sunday in the final preliminary-round game.

The defending gold medalists earned the No. 3 seed for the quarterfinals. The Finns will be seeded fourth among the final eight teams.

Sweden gets the top seed as the only team to win all three of its preliminary-round games in regulation. The U.S. will be seeded second, having won a tiebreaker with the Canadians on goal differential.

Doughty also scored midway through the first period, and Canada’s Carey Price had to make just 14 saves for the win.

Tuomo Ruutu scored for the Finns midway through the second period.

AUSTRIA 3, NORWAY 1: Michael Grabner scored two goals and Mathias Lange made 34 saves as Austria held off Norway for its first victory at the Olympic men’s hockey tournament.

RUSSIA 1, SLOVAKIA 0: Alexander Radulov and Ilya Kovalchuk scored in a shootout, Semyon Varlamov stopped 27 shots, and Russia beat Slovakia a day after losing a shootout to the U.S.