LONDON (Reuters) - London bade a flamboyant and madcap farewell to the Olympic Games with a romp through British pop and fashion, bringing the curtain down on more than two weeks of action that ended with America topping the sporting world with 46 gold medals.

There was another sellout crowd at the 80,000-capacity athletics stadium in east London late on Sunday for the final act of the tournament, and 300 million people were expected to tune in on televisions around the world.

Actor Timothy Spall read from Shakespeare's "The Tempest" dressed as war-time Prime Minister Winston Churchill, and after a London "rush hour" featuring real cars and trucks,Prince Harry entered to represent his grandmother Queen Elizabeth.

TheSpice Girls, Take That and George Michael were among the acts taking part in an exuberant finale that sought to sum up Britain's enthusiasm for the Games despite reservations about the 9 billion pound ($14 billion) cost.

During a special eight-minute segment, the stadium was bathed in the colors and sounds of Brazil, as the Olympics looked ahead to 2016 when Rio de Janeiro is the host city.

But on Sunday and into the early hours of Monday it was time for London to say goodbye, and comedianStephen Fry summed up the mood of many when he took to Twitter and wrote: "I don't want it to end *sob* *stamps foot*"

The circus-style ceremony was set to a British soundtrack of the last 50 years, featuring classic songs by Queen, the Kinks, the Beatles,Pink Floyd and more, and specially designed "pixel boxes" on every seat provided a spectacular light show.

It was always going to be a celebration for those in the stadium, rather than the showcase of the opening ceremony that featured a movie cameo by the queen and was a tribute to British history, culture and society in a message to the world.

NEXT GENERATION

The Who had the final word with "My Generation", an echo of theLondon 2012 motto which was "Inspire a Generation" as organizers and the government strive to ensure a lasting legacy that goes beyond expensive white elephants and unpaid bills.

Fulfilling promises of a "cheeky" and "cheesy" close,Eric Idle of Monty Python sang "Always Look on the Bright Side of Life", there was a giant inflatable octopus and a real-life human cannon ball flew through the air.

The Olympic flag was handed to Eduardo Paes, Rio's mayor, beforeInternational Olympic Committee president Jacques Rogge described the London Games as "happy and glorious" and declared them closed - the words taken from Britain's national anthem to the queen.

TheOlympic Flame was extinguished, fireworks filled the sky, the athletes walked off and Britain prepared to return to the reality of an economic recession temporarily buried in the inside pages of the newspapers.

The main stadium was the setting for some of the most spectacular moments of the Games, including Jamaican sprint kingUsain Bolt defending the 100, 200 and 4x100 meters titles he won in Beijing, the latter in a world-beating time.

British supporters will also cherish memories of the venue, where Somali-born runnerMo Farah won the 5,000 and 10,000 double to deafening roars and was celebrated as a symbol of the capital's multi-culturalism.

The hosts won 29 golds to take third place in the rankings, their best result for 104 years, helping lift a nation beset by severe spending cuts and worried about social stability a year after violent riots swept parts of the capital.

U.S. PresidentBarack Obama called British Prime Minister David Cameron to congratulate the country on what he called "an extremely successful Olympic games, which speaks to the character and spirit of our close ally".

PHENOMENAL PHELPS

Many will remember London 2012 for the record-breaking exploits of American swimmerMichael Phelps, who took his life-time medal haul to 22 including 18 golds, making him the most decorated Olympian in history.