Team Slovakia's goalie Jaroslav Janus makes one of his many saves on Friday afternoon in an upset of the United States at the world junior hockey championships. ((Tom Hanson/Canadian Press) )

Tomas Tatar scored twice and goaltender Jaroslav Janus stood on his head all afternoon to lead Slovakia to a huge 5-3 upset over the United States in the medal round at the world junior hockey championships in Ottawa on Friday.

The victory derailed hopes the U.S. and Canada might be able to remount their preliminary-round showdown, won by Canada, in the final.

Despite outshooting Slovakia 47-18, the U.S. could not beat Janus more than three times and will now play in the fifth-place game.

Slovakia moves on to play Sweden in one semifinal on Saturday while Canada awaits the winner of Russia and the Czechs on Friday night.

This game came two days after the Americans built a 3-0 lead on their bitter rivals the Canadians, only to be outscored 7-1 the rest of the way for a 7-4 final.

Tough start, tougher finish

It looked like this was going to be one of those frustrating afternoons for the red, white and blue right from the start of Friday's game.

Less than a minute in, the United States was awarded a penalty shot. Jordan Schroeder came in on Janus far too slowly, went to a backhand and couldn't get the puck up and over an outstretched pad.

Seconds later, star American forward James van Riemsdyk came in on a clean break and could not convert.

They continued to buzz around the Slovakian goal but it was a poor effort the other way by U.S. keeper Thomas McCollum, allowing a so-so shot by Adam Bezak to go under his catching glove, that put the Slovaks up 1-0.

Ian Cole tied it less than a minute later and things looked like they were back under control.

Slovakia found the net twice more before the end of the period, however, once by Tatar and the other from Jozef Molnar and it was 3-1 heading into the dressing room.

Everything but the kitchen sink

The American attackers threw 17 shots at the Slovaks in the second period but could not score.

Jonathon Blum finally found the net five minutes into the third and the U.S. seemed to be finally ready to pull this one out — until a controversial goal, which turned out to be the winner.

Slovakia's Richard Panik hustled down the right side, went around an American defender, who was too slow in reacting, and put a backhand into a crowd in front of McCollum.

It looked like Tatar, standing at the lip of the crease, either batted the puck in with his glove (illegal) or the shaft of his stick (legal), but after the play went upstairs for review it was determined the disk bounced off an American defender and Panik was given credit.

That made it 4-2.

An empty-netter by Slovakia and a goal when it didn't matter by van Riemsdyk finished up the scoring and the underdogs had accomplished one of the biggest upsets in world junior history.

The Americans had finished the preliminary round 3-1 while Slovakia was 2-2, making the medal round with another upset — by beating Finland in a shootout.