(CNN) -- The closing ceremony of the Sochi Winter Olympics on Sunday night took viewers through what organizers called an artistic look at Russian culture before International Olympic Committee President Thomas Bach closed what he called the "Athletes' Games."
In his closing remarks, Bach focused on how the athletes have promoted unity throughout the world.
"By living together under one roof, you have sent a message from Sochi. The message is of a society of peace, tolerance and respect," he said.
The sublime ceremony began with organizers poking fun at themselves and an opening ceremony malfunction.
As hundreds of silvery "fish" swam in the "Black Sea" on the floor of the stadium, they began to form the five Olympic rings. But like in the opening ceremony, one of the dots of white light failed to open -- at first.
Eventually, it sprang into form, to much laughter and cheers.
There also were two final medal ceremonies, including the crowd-pleasing awards for the top three -- all Russians -- in the men's 50-kilometer cross-country ski race.
The closing ceremony featured 62 classical pianists playing at one time, members of the Bolshoi and Kirov ballets performing moments from some of their most famous productions, and a tribute to Russian literary heroes like Leo Tolstoy and Aleksandr Solzhenitsyn.
"We arrived with great respect for the rich and varied history of Russia. We leave as friends of the Russian people," Bach said.
The Olympic flag was lowered and given to representatives of Pyeongchang, South Korea, the host city for the Winter Olympics in four years.
The closing ceremony brings to an end 16 days of competition during which a record 98 sets of medals were awarded. The host nation finished atop the medal standings, with 13 golds among its 33 medals.