By Michael Bristow
BBC News, Beijing
The Beijing Olympics have come to a close after 16 days of thrilling competition - with the home nation sat on top of the gold medal table.
Hundreds of performers took part in the closing ceremony
China has spent seven years planning for this event. It must be relieved that these Olympics are being hailed as both a sporting and an operational success.
Worries about air pollution, protesters and media freedom were eventually overshadowed by what went on in the sporting arenas.
At the closing ceremony the International Olympic Committee President, Jacques Rogge, said they had been "truly exceptional games".
Best of the best
The ceremony to mark the end of the games, held in the Bird's Nest stadium, borrowed some of the grand style of the opening ceremony.
Hundreds of performers were deployed in dazzling sequences that took months of planning to execute to perfection.
And this being China, there were more fireworks.
The Olympics is being seen as a success from the government all the way down to ordinary people on the streets.
"The best of the best - ever," said one compere, referring to this particular Games a few minutes before the closing ceremony started.
There was certainly an attempt at this last event to shape the way the world should think about the controversial decision to award China this year's summer Games.
The Olympic flag was handed over to London Mayor, Boris Johnson (left)
Liu Qi, president of the Beijing organising committee, said the Chinese people had honoured the commitments it made when bidding for the games.
Speaking at the closing ceremony, he said: "The Beijing Olympic Games is a testimony of the fact that the world has rested its trust upon China."
The IOC President, Jacques Rogge, suggested this Olympics would have a positive legacy.
"Through these games, the world learned more about China, and China learned more about the world," he said.
The closing ceremony is partly about handing over to the next host of the summer Games, which in 2012 will be London.
That gave the British capital the chance to stage its own mini-show within the closing ceremony.
It began when the Olympic flag was handed to recently-elected London Mayor Boris Johnson, who seemed to fumble to unfurl the banner before holding it aloft.
A red London bus than entered the stadium, out of which popped singer Leona Lewis and guitarist Jimmy Page, who together performed the rock classic "Whole Lotta Love".
Britain's most recognisable footballer, David Beckham, then appeared from inside the double-decker - surely no other London bus can have carried such an all-star cast.
To huge cheers, Beckham kicked a football into the crowd of athletes who had also paraded into the stadium.
As the bus left, pretend passengers clung to the sides holding up umbrellas.
It was an attempt to poke fun at Britain's rainy weather and its people's preoccupation with it.
But the Chinese still stole the show, with some sequences that were vast in scale and ambition.
After the event, one closing ceremony performer, Ying Ying, said her team of cheerleaders had been practising since last autumn.
"I feel very lucky just to be here. I've been moved to see so many athletes - and China has done really well," said the 20-year-old Beijing university student.
A successful Olympics, with 51 gold medals for the home country, is probably exactly what China's leaders had hoped would happen.