Curtains down on 'truly exceptional' Games.
Beijing: The Beijing Olympics, played out against a background of political intrigue and featuring 16 days of compelling and controversial action, drew to a spectacular close on Sunday.
International Olympic Committee President Jacques Rogge described the Games as "truly exceptional" in a lavish closing ceremony at the Bird's Nest Stadium which culminated in the handing over of the Olympic flag to Boris Johnson, the mayor of London, which will host the 2012 edition.
"Through these Games, the world learned more about China, and China learned more about the world," said Rogge. "These were truly exceptional Games."
The Games saw China depose the United States as the new sports superpower but the final day started with Kenyan Samuel Wanjiru relishing the heat to record an historic first Olympic marathon for the African nation.
Zou Shiming won China's first ever boxing gold and his country's 50th gold of the Games when he claimed the light-flyweight title.
At the end of the 16 days of competition and 302 events, China had 51 gold medals, 15 more than the United States on 36, with Russia winning 23 and Great Britain 19.
It is the first time China has won the gold medal count, although in total medals won the United States has 110 to China's 100.
Wanjiru, striding to Kenya's first marathon success, celebrated in the hot sun as be broke the 24-year-old Games record while those around him wilted.
"I had to push the pace to tire the other runners. I had to push the pace because my body gets tired in the heat when I slow down," he said as temperatures rose towards 30 degrees.
"It feels good to make history here. It feels good to make history for Kenya and win the gold."
Kenya may have won according to the script but the principal actors were different as the outstanding Martin Lel, a triple London marathon winner, faded to fifth and it was half-marathon specialist Wanjiru who pulled through.
China's Zou Shiming had a quick finish to the light-flyweight title for China's first boxing gold when Mongolia's Serdamba Purevdorj hurt his shoulder and his corner threw in the towel 19 seconds into the second.
There was success for Mongolia in the bantamweight final when Badar-Uugan Enkhbat won their first ever boxing gold beating Cuba's highly fancied Yankiel Leon 15-5.
It was a miserable Games for traditional ring titans Cuba and the United States.
Cuba failed to get a gold despite eight of their boxers reaching the semi-finals, while for the first time no USA boxer made the finals and they ended with a solitary boxing bronze.
The United States team of basketball multi-millionaires beat defending champions Spain as expected but the match was closer than the final 118-107 scoreline suggested.
Spain had closed to 89-91 with eight minutes remaining before Kobe Bryant provided a crucial late spark for the all-stars.
The United States picked up further gold beating Brazil 3-1 in the men's volleyball final.
Earlier, Rogge said that overall "the IOC was extremely pleased" with the Games.
"More than 40 world records were set, more than 100 Olympic records, and of course we had the two icons of the Games, Michael Phelps and Usain Bolt."
Rogge pointed to heightened environmental awareness, greater enthusiasm for sport among Chinese and the new stadia in Beijing as the legacies for China.
But he skirted around questions regarding China's response on such issues as human rights and Internet access, and diplomatically refused to be drawn into debate about the medals table.
For China, the investment of more than 40 billion dollars on the Games reaped handsome rewards.
They not only topped the gold medal count, but a near flawless organisation meant the controversies that marred the build-up largely slipped into the background.
Phelps, with his unprecedented eight gold medals and seven world records, and Bolt, the fastest man on earth winning three gold medals with three world records, were the headline stories.
At the end of Sunday's ceremony, the Olympic flag was passed to Johnson while London's position as the new host city was marked by Led Zeppelin guitarist Jimmy Page dueting with Leona Lewis on 1970s rock classic Whole Lotta Love.
Londoner, and former England football skipper, David Beckham booted a ball off the top of a London bus before the Olympic flame was extinguished.