Updated

The London Olympics closed with a tuneful and star-studded celebration Sunday night that highlighted the city and its people, music and culture.

Sixteen days after the queen (not really) leapt from a helicopter over Olympic Stadium and Paul McCartney led the crowd in a singalong to open the games, the party was back on in front of 80,000 people.

"Let us in let us in!" the British rower Anna Watkins tweeted as the athletes waited to enter the stadium in the first hour.

You could hardly blame the gold medalist.

The Who headlined the ceremony, but weren't the only big-name talent in the building.

Sharing the bill were The Kinks' Ray Davies, Annie Lennox, the Pet Shop Boys, surviving members of Queen, the Spice Girls, George Michael, Fatboy Slim and Liam Gallagher's band Beady Eye. The comedians Russell Brand and Eric Idle had parts.

All the hallmarks of a closing ceremony were there, including set pieces and pyrotechnics and a Summer Games handoff to the first South American city ever to host an Olympics, Rio de Janeiro.

Athletes entered as a group instead of country by country like in the opening ceremony and the spectacle ran shorter than the one that kicked off London's record-setting third Olympics hosting gig on July 27.

That ceremony played out in the shadow of Beijing's standard-setter four years ago, and stood up just fine. But while it highlighted accomplishments of key British figures and the British people, the closing ceremony paid homage to London and all its quirks.

A day in the life of the city from early-morning rush hour to sunset was dramatized by the physical theater group Stomp playing iconic London landmarks like they were instruments above a set covered in newspaper print.

An actor playing Winston Churchill popped out of Big Ben like a jack-in-the- box and gestured toward the royal box. Queen Elizabeth wasn't in attendance, but Prince Henry sat next to IOC president Jacques Rogge, who presided over his last Olympics.

"You have showed the world the best of British hospitality," Rogge later told the crowd. "These were a happy and glorious games."

The ceremony was a concert.

Davies performed the anthemic Kinks song "Waterloo Sunset" -- an ode to London that proved perfectly wistful.

"Dirty old river, must you keep rolling/Flowing into the night," the song begins. "People so busy, makes me feel dizzy/Taxi light shines so bright."

It goes on: "But I don't need no friends/As long as I gaze on Waterloo sunset I am in paradise."

Later, a choir sang John Lennon's "Imagine" as 101 puzzle fragments formed a likeness of the late singer-songwriter on the stadium floor.

A symphony of music celebrating British pop conceived as a love letter to its place as a beacon of innovation and invention began with Michael singing two songs and included a montage of David Bowie songs that bled into a fashion show with models walking a runway.

Lennox rode the bow of ghost galleon, singing, and Pink Floyd drummer Nick Mason played during a cover of the band's "Wish You Were Here" as a tightrope walker re-created the cover of the album with the same name.

Brand sang "Pure Imagination" atop a psychedelic tour bus and got down for a rendition of the Beatles' "I Am the Walrus." The Spice Girls rode London taxis into the stadium, reuniting for a performance to loud cheers, and Monty Python veteran Idle led a singalong to his "Always Look on the Bright Side of Life."

Gallagher and his new band played the Oasis hit "Wonderwall" and the surviving members of Queen performed after a giant screen showed video of late frontman Freddie Mercury riling up the crowd at a 1986 concert.

"We Will Rock You" was a staple at arenas here, and singer Jessie J sang the song while guitarist Brian May and drummer Roger Taylor played along.

"Today sees the closing of a wonderful games in a wonderful city. We lit the flame and we lit up the world," said London organizing chief Sebastian Coe. "For the third time in its history, London was granted the trust of the Olympic movement and once again we have shown ourselves worthy of that trust."

The Olympic flag was handed off from London mayor Boris Johnson to Rio de Janeiro mayor Eduardo Paes as his city readies itself to host the 2016 Summer Games. The Brazilian flag was raised as the country's anthem played.

The handover was followed by a Carnival parade capped by an appearance by the soccer legend Pele.

The Olympic cauldron, which remained controversially inside the stadium throughout the games, was extinguished following a routine by The Royal Ballet.

The Who played their well-known staples "Baba O'Riley," "See Me, Feel Me" and "My Generation" as a finale.

"Can't believe another Olympics has come and gone," the retired U.S. gymnast Nastia Liukin tweeted from inside the stadium.

It unfolded like so many others, but was new in some ways.

The United States finished atop the medal standings again with 104 medals, including a games-best 46 gold, beating China in both columns. But the host country also made frequent trips to the medal stand.

Great Britain racked up 29 golds among its 65 medals -- its best Olympics in more than 100 years.

"A massive, huge success for everyone," said the British diver Tom Daley, who won a bronze medal on the platform.

Sprinter Bryshon Nellum, told by doctors four years ago that he would never run competitively again after being shot in both legs, carried the U.S. flag.

Gold medal sailor Ben Ainslie carried the British flag and women's soccer player Christine Sinclair carried Canada's.

The social media Olympics saw its fair share of online scandal, including two athletes who were banned for racists tweets. A South Korean soccer player had his bronze medal withheld for displaying a political message on a flag and the games didn't pass without its share of failed doping tests, a given.

A cyclist was killed in a collision with an Olympics shuttle carrying members of the media just outside the gates of the park, but the games passed without any serious security issues despite the threat of terrorism that comes with modern-day events of this magnitude.

"We did it right," said Coe.