AP photo
An athlete holds the U.S. flag as he enters the stadium with others during the Closing Ceremony at the 2012 Summer Olympics, Sunday in London.

LONDON (AP) — British rock stars are seizing the stage to close the Olympics with an extravaganza that promises to keep a worldwide audience entertained well into the night — and dancing all the way to Rio.

The Who, the surviving members of Queen and the Spice Girls were expected to headline a fun and frivolous closing ceremony, celebrating the remarkable crop of pop icons the host country has given the world for decades.

Artistic director Kim Gavin has promised "the best after-show party that's ever been," and as details of the lineup leaked in the British press days ahead of time, there was no reason to doubt him.

The ceremony had something for everyone, from tween girls to 1960s hippies. George Michael, Muse, Fatboy Slim and the One Direction, the British cotton-candy boy band of the moment, were all expected to perform.

The best seats were for the 10,800 Olympic athletes, set to march in as one and form what Gavin has described as a human mosh pit on the field. Queen Elizabeth II, who made a memorable mock parachute entrance at the opening ceremony, will be on hand.

Eight minutes have been turned over to Brazil, host of the 2016 Games in Rio de Janeiro, which promises an explosion of samba, sequins and Latin cool. Following tradition, the mayor of London will hand the Olympic flag off to his Rio counterpart.

There will also be speeches by International Olympic Committee President Jacques Rogge and London organizing committee chief Sebastian Coe, and the extinguishing of the Olympic flame.

What a way to end a games far more successful than many Londoners expected. Security woes were overcome, and traffic nightmares never materialized. The weather held up, more or less, and Britain had its biggest medal haul since 1908.

The United States edged China in both the gold medal and total medal standings, recapturing the gold-medal title it lost four years ago, but Britain will finish third in golds.

And while the games may have lacked some of the drama and grandeur of the Beijing Olympics in 2008, there were some unforgettable moments.

Jamaican sprinter Usain Bolt became an Olympic legend by repeating as champion in both the 100-meter and 200-meter sprints. Michael Phelps ended his long career as the most decorated Olympian in history.

British distance runner Mo Farah became a national treasure by sweeping the 5,000- and 10,000-meter races, and favorite daughter Jessica Ennis became a global phenomenon with her victory in the heptathlon.

Female athletes took center stage in a way they never had before. American gymnast Gabby Douglas soared to gold, the U.S. soccer team made a dramatic march to the championship. Packed houses that turned out to watch the new event of women's boxing. And women competed for Saudi Arabia, Qatar and Brunei took part for the first time.

And then there was Oscar Pistorious, the double-amputee from South Africa running on carbon-fiber blades, who didn't win a medal but nonetheless left a champion. And sprinter Manteo Mitchell, who completed his leg of the 4x400 relay semifinal on a broken leg, allowing his team to qualify and win silver.

All of it took place in the coming-of-age of the Twitter-era, with athletes posting their every thought, from drunken celebrations to royal crushes to frowned-upon shout-outs to sponsors.

"It was a dream for a sports-lover like me," Rogge said of the two weeks of competition.

Coe refused to anoint the games "the best ever," in the phrase former IOC chief Juan Antonio Samaranch used to describe almost every games. But he declared himself "very, very pleased."

He said the closing ceremony didn't aim to be profound, not even the irreverent romp through British history offered by Danny Boyle's $42 million spectacle on opening night.

The theme for the close, Coe said, could be summed up in three words. "Party. Party. Party."

In a switch from opening night and what appeared to be a concession to its vocal critics, NBC decided to stream the ceremony live online, in addition to broadcasting it during prime time.

London organizers tried to keep the ceremony under wraps, but photographs of their rehearsals, in an old car plant in east London, made the British papers almost daily.

The show will include performances of 30 British hit singles from the past five decades — whittled by Gavin from a list of 1,000 songs.

Gavin said Saturday the show would open with a tribute to the "cacophony" of London life, with a soundtrack ranging from late Edward Elgar, composer of the "Pomp and Circumstance" march, to The Kinks' "Waterloo Sunset." Frontman Ray Davies is expected to perform the 1960s song, a love letter to London.

While creators of the opening ceremony could rehearse for weeks inside the stadium, Gavin and his team had less than a day between the end of track and field competition and Sunday's ceremony. Not a lot of time to practice a show with multiple sets, pyrotechnics and 3,500 volunteer performers.

Some athletes who skipped the opening ceremony in order to rest for upcoming competitions said they wouldn't miss the closing extravaganza for the world.

"I am so excited," said American teen sensation Missy Franklin, who took home five swimming medals, including four golds. "I think it is the perfect way to end the entire journey."

Added Brenda Villa, a member of the gold-winning U.S. water polo team: "We just want to have fun and kind of put an end to this magical tournament."