Canada already had clinched first place in Group B at the Ivan Hlinka Memorial Tournament, but they wanted to end preliminary-round play Wednesday on a positive note.
It took until the final 3:45 of the game, but they left the ice at Zimny Stadion in Piestany, Slovakia with smiles on their faces following a 3-2, come-from-behind win against Slovakia.
Center Sam Reinhart, a top candidate for the 2014 NHL Draft who plays for the Kootenay Ice in the Western Hockey League, capped Canada's comeback by scoring the winning goal with 53 seconds left in regulation.
Defenseman Joshua Morrissey, who plays for the Prince Albert Raiders of the Western Hockey League and is a candidate to be a first-round pick in the 2013 draft, had a hand in all three Canada goals, scoring once and assisting on two.
Canada next faces the Czech Republic in one of Friday's semifinals. The Czechs clinched second place in Group A with a 3-2 defeat of Russia on Thursday at Alcaplast Arena in Breclav, Czech Republic.
Slovakia led Canada 2-0 heading into the final minutes of regulation on goals by Kristian Horvat and Martin Ambroz and shutout goaltending by Maros Mikolas.
"We played like we were through for the first period," Canada coach Todd Gill said. "Finally we kicked it up a notch but we just couldn't put the puck past their goalie."
Ryan Kujawinski, a center with Kingston of the Ontario Hockey League, got Canada on the board when he scored off a Morrissey set-up with 3:45 left.
Canada then took advantage of a Slovakia penalty, with Morrissey scoring to tie the game five seconds into the man advantage.
"The No. 1 thing I think for Canada is we have all our best players here, and when we hit some adversity, individualism kicks in," Gill said. "It's not because they're selfish, they just want to do something to get us over the hump.
"That happened in the first two periods, and in the third we started playing our system, and we were all over them and were lucky enough to get the three goals."
Reinhart scored the winner off a Max Domi pass to keep Canada, the four-time defending champion, undefeated.
"We had a really good chance just throwing a bouncer on net and the goalie got back and just made a great save on it," Reinhart said. "We regrouped on the faceoff and just started getting pucks on the net again, and soon after we had a mini-break and [the puck] just went in off the goalie's glove and over him."
Slovakia, which finished preliminary-round play 0-3, next faces the United States in the seventh-place game of the Under-18 tournament. The U.S. team lost to Finland 8-6 at Alcaplast Arena in Breclav, Czech Republic. The loss left the Team USA winless in early round play at 0-2-1.
Adam Erne, a top player for the 2013 draft who plays for the Remparts in the QMJHL, had two goals and an assist for the United States. Trevor Moore, Gabe Guertler and Corey Ronan also scored for the U.S. team.
"We put in a great effort but fell short," U.S. coach Matt Herr said. "We started to find a rhythm and play well, but it's hard to have a game plan for a game like that. We play against Slovakia on Friday, so we'll try to find that groove again to be successful."
Finland led 2-1 after one period, but a wild second saw the teams score seven goals and end tied 5-5.
Finland scored twice in the first 7:52 of the third period to take a 7-5 lead, but Vinny Lettieri scored at 14:14 to make it a one-goal game. However, that's also close as the U.S. team could get; Finland added an empty-net goal with 1:36 left.
In other action Wednesday, Sweden got a pair of goals from Lucas Wallmark en route to an 8-4 defeat of Switzerland in Piestany. The victory clinched second place in Group B for Sweden. They'll face Finland in one of Friday's semifinals.
The Czech Republic's defeat of Russia, which led Group A heading into Wednesday's final day of early-round play, created a logjam at the top of the group, with Russia, Finland and the Czech Republic all finishing 2-1. Finland and the Czech Republic advanced on tiebreakers, with Russia left to play Switzerland in the fifth-place game Friday.
Contact Adam Kimelman at email@example.com. Follow him on Twitter: @NHLAdamK