Host nation Russia finished on top of the medal table as the 22nd Winter Olympics came to a close in Sochi on Sunday after 17 days of competition.
International Olympic Committee president Thomas Bach officially closed the Games during an extravagant 130-minute ceremony.
South Korea were given the Olympic flag as Pyeongchang hosts the 2018 Games.
The build-up to the Games was overshadowed by concerns over the threat of a terrorist attack and the impact of protests against Russian anti-gay legislation.
But Bach said Russia and the Black Sea resort city of Sochi had "delivered all that it promised" and risen above the concerns to deliver an impressive Olympics.
"These were excellent Games that may lead to the reversal of some criticism of the Russian organisers that preceded the Olympics," he said.
Bach used his speech at the closing ceremony in the Fisht Stadium to emphasise Olympic values.
"By living together under one roof in the Olympic Village you send a powerful message from Sochi to the world, that of a society of peace, tolerance and respect," he said.
"I appeal to everybody implicated in confrontation, oppression and violence to act on this Olympic message of dialogue and peace."
Russian President Vladimir Putin, who watched the ceremony from the stands and made several appearances at the Games to oversee the nation's investment of £600m in elite sport, did not get his wish of a gold medal in the ice hockey.
But victory for the four-man Russian bobsleigh team gave the host nation their 13th gold medal of the Games – and 33 medals in total – to ensure they topped the medal table, emulating Canada's achievement four years ago.
It marked a stunning turnaround from the 2010 Vancouver Games where Russia won just 15 medals, including three golds, to finish 11th overall – their worst ever result.
"People kept asking me whether I believed Russia could do as well as Canada did in Vancouver and I didn't believe it," said Russian Alexander Legkov, who won gold in the 50km cross-country.
"Now this is our pride, it's wonderful. What could be better than ending the Olympics with a gold medal and helping Russia top the medal table?"
The Games cost £30bn, making Sochi the most expensive Olympics ever, and featured a record 2,800 athletes from 88 countries, with 12 new events added to attract young audiences.
But there were also six failed drugs tests – five more than in Vancouver – as the most extensive anti-doping programme in Winter Olympics history saw a record 2,453 tests carried out.
The host nation's problem with stray dogs has been well documented and struck a chord with many competing athletes.
Many have adopted dogs, while US ice hockey player David Backes is working on plans to open a shelter back home and bring the strays over.
Organisers made a joke at their own expense in the closing ceremony as dancers formed themselves into four rings and a small clump in a nod to the malfunction in the opening ceremony, when one of the Olympic rings failed to open.
For Britain, Sochi marked a record-equalling Winter Olympics, their tally of four medals matching their haul in the inaugural 1924 Games in Chamonix, France.
In doing so, the 56-strong team surpassed the medal target of three set by UK Sport, which awards funding, to raise hopes of a financial boost ahead of the 2018 Games.
The total could have been greater still, with the men's four-man bobsleigh team and snowboarder Jamie Nicholls coming close to a podium finish, and short track speed skater Elise Christie suffering the misfortune of three disqualifications.
Britain's athletes now must wait until June to find out whether they will be funded for the next Olympic cycle.
Great Britain chef de mission Mike Hay told BBC Sport: "I am proud of the team's achievements. We have competed to the utmost of our ability.
"I'm delighted with everybody, not just with the medals, but with the number of finals and top-half finishes we have had.
"We have won four medals, which sets a new standard for us. We have come a long way from Vancouver 2010 where we won just the one medal.
"The team has a young profile and I believe we can do even better in Pyeongchang in 2018."
South Korea, with a budget of £7bn for the 2018 Games, will become only the second Asian country to host a Winter Olympics after Japan staged the Games at Sapporo in 1972 and Nagano in 1998.
- ‘I’m on the run until this country shows me there are laws’ – Shatta Wale
- Fact-check: Did the NPP promise to build a harbour in Cape Coast?
- A flimsy excuse should not be given for denial of a visa to MPs – Sam George calls out Netherlands Ambassador
- We’re investigating Shatta Wale’s shooting claims – Police
- Funny Face arrested after threatening to kill his baby mama and commit suicide
- I no longer use a mobile phone – Kwabena Kwabena
- Komenda Sugar Factory: Mahama constructed roof before building foundation – Akufo-Addo
- Robbers made away with over ¢100k in alleged bullion van attack
- Akufo-Addo’s denial of promise to build harbour in Cape Coast is shocking – Abeiku Adams
- Man kills daughter, 16, after finding out she’s not his biological child
Accept your postings and ignore middlemen – NSS Boss tells newly posted personnel
Volta will get its share of national cake when NDC comes to power – Mahama
Digital currency space needs to be explored with all seriousness – Julian Opuni
Man exhumes corpse at Awutu Ayiresu; claims ghost ordered him
What it means if your boyfriend has a lot of female friends
Team up and start early – KNUST lecturer guides students on how to raise capital for own businesses
Authorities heed calls to revive trading activities at Obuasi Kunka Market
Anbariya Sunni Muslim group presents memorandum in support of anti-LGBTQ bill
FESPACO 2021: African film lovers come together in Ouagadougou
ECG installs smart prepaid meters at Agbogbloshie market
CAGD backtracks on ‘No Ghana Card, No Salary’ directive to public sector workers
Samuel Dowuona: Extra spectrum; bridging data capacity gap in Digital Ghana
Salah is extraordinary, says Simeone as his Atletico side prepare for Liverpool
Photos: Tema Central sewerage system collapse exposes residents to health hazard
ECG to disconnect GBC, Kumasi International Airport over debt