TORONTO — The United States ended a near decade-long losing streak against Russia on Thursday at the world junior hockey championship.

Troy Terry's second-period goal stood as the winner as the U.S. beat Russia 3-2 for its first victory over the Russians at the under-20 tournament since 2007, a stretch of five consecutive losses.

"Especially with the history that we have, the core group of (national team development program) players we have, they've beat us the past couple times so that made it a little sweeter to beat them," said Terry.

The win temporarily moved the U.S. ahead of Canada in the Group B standings, but the Canadians beat Latvia 10-2 later Thursday evening to match the Americans at 3-0-0 and nine points.

Terry, an Anaheim Ducks prospect, scored 11:41 into the second period to give the U.S. a 3-1 lead. Terry re-directed an Erik Foley shot between the legs of Ilya Samsonov for his second goal of the tournament.

"I was calling for it. (Foley) passed it to me, (but) I was at a bad angle so I tried to just kind of direct it on net," Terry said. "I got kind of lucky, but I'll take it."

Clayton Keller and Colin White had the other goals for the Americans while Tyler Parsons stopped 25 shots in the victory.

The Americans were awarded a penalty shot with 1:29 remaining in the third after Russian defenceman Sergei Zborovski purposely knocked the net off. But Samsonov executed a well-timed poke check on Tage Thompson to keep it a one-goal game.

Kirill Urakov and Kirill Kaprizov responded for the Russians while Samsonov made 34 saves.

"We just took too many penalties in the first period, we're on the (penalty kill) a lot in our (defensive) zone — that was kind of hard," said Montreal Canadiens prospect Mikhail Sergachyov. "Our goalie made some big saves and kept us in the game, we should've scored.

"They didn't do anything special, we got power-play chances (in the third), but their goalie played good, there weren't any rebounds."

Keller opened the scoring at 4:14 of the first period, beating Samsonov with a backhand shot while falling for his third of the tournament.

Urakov responded for the Russians just over seven minutes later, batting a Yakov Trenin feed out of mid air and past Parsons for his first of the world juniors.

The Americans scored twice in the second period to open a 3-1 lead on the Russians.

White restored the U.S. lead with his third of the tournament, putting the rebound off of Charlie McAvoy's point shot in to a wide open net at 4:03.

After Terry gave the U.S. a two-goal lead, Kaprizov pulled the Rusians to within one, getting his stick on a Yegor Rykov point shot on a power play with under three minutes remaining in the second.

The U.S. and the Canadians will meet on Saturday in the final round-robin game for each team. The top seed in Group B will be on the line.

"It's a game you grow up watching, that New Year's Eve game. To have it in Canada here, you grow up seeing that, we're not going to be liked that's for sure," said McAvoy, a Boston Bruins prospect. "We're not expecting much love, it's going to be us against kind of their whole country."

Russia concludes the preliminary round on Saturday against Slovakia.