A musical mishmash of eras and styles closed the London Olympics in a long and raucous fashion on Sunday night to complete what its director called the “after-party” of this 17-day global event.

There were the familiar music icons, including the Pet Shop Boys, the reunited-for-a-night Spice Girls, Annie Lennox, Ray Davies, Fatboy Slim and singer George Michael, who was making his first live appearance since recovering from pneumonia last year.

The Who closed the show with a four-song set that concluded with “My Generation.”

In what was called “A Symphony of British Music,” there were the quirky elements witnessed in the opening ceremony last month accompanied by a surreal twist. You don’t quite associate the International Olympic Committee or the British royal family with an enormous, fluorescent multi-colored octopus, but there was DJ Fatboy Slim coming into view from its head.

Not only did the closing ceremony celebrate the wildly successful event in what Sebastian Coe, the chair of London’s organizing committee, called a wonderful games in a wonderful city, it featured the official handover to Brazil, hosts of the 2016 Summer Games.

That will mark the first time a South American country has hosted the Olympic Games, and Rio had its eight minutes in the spotlight in the closing ceremony. Boris Johnson, the mayor of London, handed the Olympic flag to IOC President Jacques Rogge, who then presented it to Eduardo Paes, the mayor of Rio de Janeiro.

“When our time came, Britain, we did it right,” Coe said. “We lit the flame and we lit up the world.”

True, little went wrong for the organizers, who had dealt with a steady dose of gloom in the run-up to the Olympics, pessimistic predictions of gridlock and transport nightmares.

Those fears never quite materialized.

Not only that, but Britain was treated to a hugely successful series of performances by its athletes. The gold-medal count for Britain has skyrocketed from one in Atlanta in 1996, to nine in Athens in 2004 to 29 in London.

In keeping with the theme of the Games, there was a nice populist touch befitting the closing ceremony as some of the athletes came down through the stands, walking among spectators, to reach the field in the Parade of Athletes.

Carrying the flag for the United States in the closing ceremony, by choice of U.S. team members, was 23-year-old track star Bryshon Nellum, who was shot in the legs four years ago and required three operations to return.

ALSO:

Stephen Kiprotich wins men’s marathon

U.S. defeats Spain for men’s basketball gold

Bakersfield’s Jake Varner wins wrestling gold