has gone hand-in-hand with a generally well-run Games, so far untouched by violence at the hands of Islamist militants opposed to President Vladimir Putin and his pet project.
Voices of dissent over Russia's human rights record, particularly regarding legislation that critics say discriminates against gays, have occasionally crashed the party, but attention has largely focused on sport.
RUSSIA PROVES CRITICS WRONG-BACH
IOC President Thomas Bach said the Russian hosts had proved their critics wrong.
"Tonight we can say: Russia delivered all what it had promised," he told 40,000 people at the closing ceremony and millions more watching on television.
"What took decades in other parts of the world was achieved here in Sochi in just seven years."
Addressing the army of volunteers who helped guide athletes, reporters and visitors to their destinations, he added:
"Through you, everybody with an open mind could see the face of a new Russia: efficient and friendly, patriotic and open to the world. We arrived with great respect for the rich and varied history of Russia. We leave as friends of the Russian people."
Bach then formally declared the Sochi Games closed.
The Olympics had more than 2,800 athletes from 88 countries - both records - and featured 12 new events to attract younger fans and more broadcasters than ever before.
However, the Games have also seen six doping cases, five more than at the 2010 Vancouver Olympics.
Early on Sunday Austrian cross-country skier Johannes Duerr, who placed eighth in the skiathlon, tested positive for performance-boosting EPO and was excluded from the Games, according to the Austrian Olympic Committee.
"There's nothing left for me than to apologise to everyone. To my family, my wife," Duerr told Austrian TV ORF at the airport as he was leaving.
Bach said the number of cases proved that the system of testing athletes was working.
"The number of cases for me is not really relevant. What is important is that we see that the system works," he said, addressing reporters hours before the closing ceremony.
The show was staged at the Fisht Stadium, one of several gleaming arenas built in Sochi that helped push the price tag for Russia's first Winter Games to an