The International Olympic Committee gave the Beijing Games a clear thumbs-up on Sunday, brushing aside criticism and arguing they had left a positive legacy for China.
On the final day of competition, Kenya's Sammy Wanjiru led an African sweep of marathon medals, lifting his arms in triumph as he accelerated around the Bird's Nest stadium for the last lap.
China are also celebrating the end of a spectacular Olympics, sitting proudly on top of the medals table and with a closing extravaganza planned in the Bird's Nest stadium.
They will be pleased with the IOC's verdict, President Jacques Rogge praising an "impeccable" operation that had set the bar very high for London in 2012.
Responding to criticism the Games had not led to progress in human rights, Rogge said the sporting body could not force change on a sovereign state "or solve all the ills of the world".
Nevertheless, he said the host country had been "scrutinized" by the world and had opened itself up.
"The world learned more about China, and China learned more about the rest of the world. And together, we shared the excitement and drama of the Games," Rogge said.
The government was intending to invest heavily in mass sports to harness popular enthusiasm, he said, while the Games had also promoted a heightened awareness of the environment in China.
Beijing's polluted air had been one of the biggest concerns in the run-up, and health concerns led Ethiopian world record holder Haile Gebreselassie to pull out of the men's marathon.
In the end, those fears appeared largely unfounded when the race was held, after the government spent billions to clean the air in recent months and an overnight storm did the rest.
Running under blue skies, Wanjiru crossed himself and sank to his knees after finishing in an Olympic record time of two hours six minutes 32 seconds, looking fresh despite the heat and sealing a fifth gold for his country in athletics.
"I pushed and pushed, I had to, to tire the others," Wanjiru said. "My plan was to push my body to the limits."
Despite their pedigree of distance running and big-city marathon wins, it was Kenya's first Olympic marathon title. Morocco won the silver, Ethiopia the bronze.
The race began in the capital's massive Tiananmen Square, symbol of Communist rule, site of Mao Zedong's mausoleum and of pro-democracy protests in 1989. It ended in the Bird's Nest, symbol of China's modern face.
REDEMPTION FOR THE UNITED STATES?
Russia won gold in the women's group rhythmic gymnastics to cement third place in the medals table. There are another 10 golds to contest on Sunday, including the finals of men's basketball and volleyball, and six big bouts in the boxing ring.
In the final of the men's basketball, the U.S. giants of the NBA are expected to beat Spain to win the gold that eluded them at the 2004 Athens Games.
The Americans also hope to settle a score against Brazil in men's volleyball, after losing to them in the women's final.
Two golds would bring the United States up to 36 golds, level with their table-topping haul in Athens.
They would still be far behind hosts China, who have dominated the medals table from start to finish, battering all-comers into submission with 49 golds.
With one fifth of the world's population to choose from, China have poured billions into a Soviet-style training system geared to maximizing medal success.
Their new sporting superpower status reflects their emerging global economic might, and China's government feels the $43 billion investment in the Games was money well spent.
"The Chinese nation's Olympic dream has always been bound to its course of national revival," state news agency Xinhua said. "The Beijing Olympic Games have added impetus for national self-confidence."
British Prime Minister Gordon Brown and former England soccer captain David Beckham will be at the Bird's Nest on Sunday night as the Olympic flag is lowered and passed to the 2012 hosts, a nation delighted over their fourth place in the medals table.
Beckham said in an interview on Saturday that China could be very proud of what they had done in staging the Olympics, but promised London would do even better, "without a doubt".
The former Manchester United and Real Madrid midfielder, now playing for LA Galaxy, will be joined during London's eight-minute slot in the Games finale by Led Zeppelin guitarist Jimmy Page and singer Leona Lewis.
"There was obviously a lot of negativity leading up to the competition," Beckham said. "But everyone knew that once the Games actually started, that would disappear and the success of the teams and the athletes would take over."