OTTAWA - John Tavares of the Oshawa Generals scored a hat trick in Canada's come-from-behind 7-4 win over the U.S. at the world junior hockey championship Wednesday.

Canada (4-0) finished first in Pool A with the victory and earned a bye to Saturday's semifinal round with the victory.

Tavares, the projected possible No. 1 pick in the NHL entry draft, sparked Canada's comeback by scoring his team's first two goals and added an empty netter.

Jordan Eberle of the Regina Pats, Zach Boychuk of the Lethbridge Hurricanes, Tyler Ennis of the Medicine Hat Tigers and Cody Hodgson of the Brampton Battalion also scored for the defending champs. Belleville Bulls defenceman P.K. Subban added two assists

Dustin Tokarski of the Spokane Chiefs recovered from a shaky first period and earned the win by stopping 22 of 26 shots.

Boston College's Kevin Shattenkirk and Jimmy Hayes, plus Seattle Thunderbirds forward Jim O'Brien and Vancouver Giants defenceman Jonathan Blum scored for the U.S. (3-1) who will face Slovakia in a quarter-final Friday.

American goaltender Thomas McCollum of the Guelph Storm made 24 saves on 29 shots.

Sweden also went undefeated in Pool B to earn a semifinal bye with a 5-0 win over Russia (3-1). The Russians meet the Czech Republic (2-2) in Friday's other quarter-final.

The Czechs thumped Kazakhstan 10-2 to finish third in Pool A. The Slovaks beat the Finland 3-2 in a shootout to secure a berth in the medal round.

The Canada-U.S. matchup was the highly-anticipated game of the round robin by players from both countries and the fans at Scotiabank Place. The 20,223 in attendance set another single-game tournament record and bested the previous mark set in Canada's first game of the tournament.

Canada and the U.S. had fairly easy rides until Wednesday, outshooting their opposition 28-2 and 24-5 in their first three games respectively.

Their meeting lived up to its billing in a see-saw, albeit penalty-filled, battle. Canada fell behind 3-0, but recovered to tie the game before the end of the first period.

It started badly for Canada as the U.S. scored on their first shot of the game on Tokarski and were up 3-0 by 12:35.

The Canadians, trailing for the first time in the tournament, pulled themselves together to tie it up before period's end on the strength of two goals by Tavares, who leads the tournament in goals with eight.

Canada's tournament-leading power play was the difference with four goals on seven opportunities, while the U.S. were good on two of five.

Tokarski redeemed himself for a mediocre first period by robbing Colin Wilson's backhand attempt with less than two minutes to go in the second period and a stopping Wilson's other attempt from close range late in the third.

Tavares, from Oakville, Ont., then sealed the win with his empty-netter. Ennis scored with 10 seconds remaining.

Hodgson scored the go-head goal at 6:56 of the second period, deflecting a shot off a U.S. player in front of the net.

That avenged a similar goal scored by the Americans to tie it at 3:40. Blum's pass from the corner bounced off Brett Sonne's skate and across the goal-line..

Boychuk gave Canada the lead for the first time in the game 37 seconds into the second period with a power-play goal.

Quick cycling of the puck gave Eberle enough time to chip the puck over McCollum for a power-play goal at 18:10 of the opening period.

Tavares sidestepped a sprawling U.S. defenceman to wire the puck upstairs at 15:43. Just 48 seconds earlier, Tavares started the comeback by tucking a rebound past McCollum's skate.

O'Brien, a teammate of Canadian captain Thomas Hickey on the Thunderbirds, fooled Tokarski with a shot from the top of the faceoff circle at 12:35.

Hayes made the most of a two-man advantage for the U.S., scoring from the slot at 7:15. Shattenkirk beat Tokarski five-hole at 3:49.

An enormous Canadian flag that was introduced in the tournament opener for the home team circled the lower bowl prior to puck drop.

According to USA Hockey's game notes, U.S. players who attended Christmas Eve church service in downtown Ottawa were asked by people in the congregation if they were going to finish second in the tournament.