Raucous spectators chanted "Ro-ssi-ya! Ro-ssi-ya!" - "Russia! Russia!" - before being surrounded by multicolored fireworks and carried through a visually stunning, sometimes surrealistic panorama of Russian history and culture. The crowd was in a party mood after the high-security games passed off safely without feared terror attacks.
"This is the new face of Russia - our Russia," said Dmitry Chernyshenko, head of the Sochi organizing committee. He called the games "a moment to cherish and pass on to the next generations."
In a charming touch, the Sochi organizers used the ceremony to make a joke at their own expense. Dancers in shimmering silver costumes formed themselves into four rings and a clump in the center of the stadium. That was a wink to a technical glitch in the Feb. 7 opening ceremony, when one of the five Olympic rings in a wintry opening scene failed to open. The rings were supposed to join together and erupt in fireworks.
This time, it worked: As Russian President Vladimir Putin watched from the stands, the dancers in the clump waited a few seconds and then formed a ring of their own, making five, drawing laughs from the crowd.
The closing ceremony bid farewell from Russia with love, pageantry and protocol - a nod to the year that Putin seized upon to remake Russia's image with the Olympics' power to wow and concentrate global attention and massive resources.
See which countries rank with the Olympic medal tracker on ESPN.com
Only three events were held on the final day of competition Sunday: the men's hockey gold medal game, cross country and the men's four-man bobsled.
Canada defended its Olympic men's hockey title Sunday with a 3-0 victory over Sweden in the gold-medal game. They confirmed their worldwide dominance in their national game by winning gold for the third time in the last four Olympics.
Allowing just three goals in six victories in Sochi, Canada became the only repeat Olympic champ in the NHL era and the first team to go unbeaten through the Olympic tournament since the Soviet Union in Sarajevo in 1984.
The host nation is also finishing strong at the Sochi Games. The Russians swept the podium in the men's 50-kilometer cross-country race and also won gold in the four-man bobsled on the final day of the games. That race just wrapped up, and the USA Team-1 won the bronze medal. USA Team-2 came in 12th place.
Check out photos of the 2014 Sochi Winter Olympics competitions
On Sunday, the fifth and sixth doping cases surfaces. Austrian cross-country skier Johannes Duerr was kicked out of the games after testing positive for the blood booster EPO.
Swedish Olympic officials also announced that hockey player Nicklas Backstrom failed a doping test. The substance he tested positive for has not been identified.
Sunday's performances helped the Russians finish with the most gold medals (13) and most total medals (33) of any nation four years after the country's worst Winter Games performance ever.
The United States came in second place with 28 medals, including nine gold. Norway rounded out the top three with 26 medals, followed by Canada with 25 medals, and Netherlands with 24 medals.
A look at Sunday's events:
HOCKEY: The Canadians won gold for the third time in the last four Olympics. Jonathan Toews scored in the first period and captain Sidney Crosby scored his first goal of the tournament in the second. Chris Kunitz also scored and Carey Price made 24 saves for Canada. Henrik Lundqvist stopped 33 shots for the injury-depleted Swedes.
CROSS-COUNTRY SKIING: Alexander Legkov got down to work in a hurry. He led a Russian sweep of the men's 50-kilometer cross-country race. He was followed by Maxim Vylegzhanin and Ilia Chernousov. That assured Russia of finishing with the most medals. It was also the host nation's first gold in the sport in Sochi. "This is priceless," Legkov said. "It's more valuable than my life."
BOBSLED: After struggling these last years, Alexander Zubkov set things right. He drove Russia to victory in the four-man sled, adding to his two-man title in Sochi. He is the sixth pilot to sweep those events at an Olympics but the first to do so in his home country. Steven Holcomb, the 2010 Olympic champ, won bronze to give the U.S. seven sliding medals in Sochi, tops among all countries. Oskars Melbardis of Latvia took the silver. Germany had no medals in the four-man for the first time since 1968.
The Associated Press contributed to this report.