The United States defeated Russia 5-3 to finish top of Group A at the International Ice Hockey Federation (IIHF) World Championships.
Despite going on to win the game, it proved far from comfortable for the Americans at the Lanxess Arena in Cologne.
The Russians led after 12 minutes when Nikita Gusev scored his first of the match.
Within a minute of the start of the second period, the US were level through Kevin Hayes, but Russia were soon in front once more when Anton Belov scored.
Dylan Larkin restored parity at 2-2 before Gusev's second of the match put Russia in command once again.
Hayes' second pulled the US level before they were finally in front for the first time when Anders Lee scored midway through the third period.
The victory and top spot were then secured when Brock Nelson added a fifth for the Americans.
"It's a big win, it's pretty special to win and to come top of the pool," said Johnny Gaudreau of the US.
"It's one of the goals we set at the start of the tournament and play well in the medal rounds.
"It's a great win, I think we grew as a team today.
"It was a great effort."
In the other matches in Group A today, Sweden secured third place after they beat Slovakia 4-2 in Cologne while Germany took fourth spot following a shootout win against Latvia this evening.
With the score tied at 3-3 and neither side able to score a winner in overtime, Frederik Tiffels scored the decisive penalty.
Canada secured top spot in Group B with a comfortable 5-2 win over Finland at the AccorHotels Arena in Paris this evening.
The tournament's defending champions got back to winning ways against Norway yesterday following a 3-2 overtime defeat against Switzerland two days before and maintained their resurgence in the French capital tonight.
Mitch Marner opened the scoring for the North Americans after just two minutes before Jani Lajunen responded for the Finnish team just seconds later.
Colton Parayko put Canada back in front before Marner's second gave Canada a 3-1 lead at the first buzzer.
That was soon 4-1 when Brayden Point scored before Finland's Atte Ohtamaa cut the deficit to 4-2.
Within 34 seconds of the third period the scoring was complete when Canada's Matt Duchene scored his country's fifth.
Switzerland made sure of a second place finish in Group B after they overcame the Czech Republic 3-1.
The Czech Republic still finished third while Finland occupy fourth.
In today's third match, Belarus defeated Norway 4-3 in the French capital.
Tomorrow will see the competition take a rest day before action resumes on Thursday (May 18) with the quarter-finals.