Sidney Crosby scored the winner in overtime as Canada won the Olympic title on Sunday, beating the United States 3-2 to become the first host nation to capture gold in 30 years.

Crosby got the winning goal 7:40 into the overtime period, taking a pass from Jarome Iginla and sliding a shot under the pads of US goalkeeper Ryan Miller.

Jonathan Toews and Corey Perry also scored goals for Canada who won their second gold in the past three Olympics.

Roberto Luongo was superb in goal, making 34 stops for Canada who became the first host to win an Olympic final since the US did in at Lake Placid in 1980.

Ryan Kesler and Zac Parise scored for the US who suffered their first loss of the tournament after five straight wins.

Canada had a 2-1 lead in the third and looked headed for victory but US clawed its way back as Parise scored with just 24 seconds left to send the game to overtime.

Miller had looked unbeatable until Sunday's game and he made several key stops to keep the score close.