A spectacular ceremony has been held in Vancouver to officially close the Winter Olympics.
There was euphoria in Canada after the men's ice hockey team won the country's 14th gold medal in the last event on Sunday, providing a perfect ending for the host nation after a troubled start to the Games.
After surrendering a two-goal lead, the Canadians finally clinched gold, scoring the winning goal in overtime against the United States to take the game 3-2. Thousands of people then poured out onto the streets of Vancouver to celebrate the win over their arch-rival.
After 17 days of competition Canada topped the medal table, with 14 golds, seven silvers and five bronze medals.
The victory in the ice hockey set a new record for golds won at a single Winter Games, surpassing the previous mark of 13 jointly held by the Soviet Union and Norway.
The US also set a record for the most overall medals at a single Winter Olympics, finishing with 37, one more than Germany in 2002.
The Games, which featured 2500 athletes from 82 nations, had begun in the worst possible way with the death of Georgian luger Nodar Kumaritashvili.
The 21-year-old was killed when his sled flipped and he hit a steel pole during a training run on the much criticised, high-speed Whistler Sliding Centre track.
Jacques Rogge, president of the International Olympic Committee, admitted the death of Kumaritashvili had hit him hard, before going on to praise the efforts of the Games organisers who battled unseasonably warm, wet weather and a resulting lack of snow.
The closing ceremony on Sunday lasted more than two hours and featured Canadian actors William Shatner and Michael J. Fox.
Skeleton racer Ben Sandford carried the flag for New Zealand. He achieved the country's best placing in the Games, coming 11th in his event.
The Olympic flag has been handed to the Russian city of Sochi, the host of the 2014 Winter Games.