China basked in the glow of their 51st gold medal and got a clear thumbs-up from International Olympic Committee on the last day of the Games on Sunday.
The hosts finished well clear atop the medals table with 15 more golds than the United States. The last of the 302 gold medals was won by France in the men's handball.
The IOC brushed aside criticism of its decision to hold the Games in China. It said Olympics could not solve all the world's problems, but argued they had left a positive legacy for China.
The United States was less enthusiastic, pressing for the immediate release of eight Americans detained for staging protests in favor of Tibetan independence during the Games.
"We are disappointed that China has not used the occasion of the Olympics to demonstrate greater tolerance and openness," the US Embassy said in a statement.
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.
There was emotion too for the American men's volleyball team, settling a score against Brazil who had beaten their compatriots in the women's final the previous day.
The team's determination to win final-day glory had also been reinforced when the father-in-law of the team's coach was stabbed and killed in Beijing on the first day of the Games.
There was redemption for the Americans in the men's basketball, with giants of the NBA beating Spain 118-107 in a thrilling final to win the gold that eluded them at the 2004 Athens Games.
China also picked up two more golds on the last day.
A surprise win by Zou Shiming in the boxing ring earned the hosts their 50th gold, the first time that landmark had been reached since the Soviet Union got 55 golds in Seoul in 1988. Zhang Xiaoping won the light-heavyweight title.
Shiming said he was "proud to show the strength of the Chinese people with my fist".
The hosts plan to celebrate with a closing extravaganza later when they will hand over the Olympic flag to 2012 hosts Britain.
They will be pleased with the IOC's verdict. President Jacques Rogge praised an "impeccable" operation that had set the bar very high for London in 2012.
He said the sporting body could not force change on a sovereign state "or solve all the ills of the world". Nevertheless, the host country had been "scrutinized" by the world and had opened itself up, he said.
"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.
Rogge, though, had less to say when confronted with the tale of two women in their seventies, who were sentenced to a year's re-education for applying to stage a protest during the Games.
"The reply we received from authorities was that this was an application of Chinese law," he said. "The IOC is not a sovereign organization and we have to respect Chinese law."
CLEARING THE AIR
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.
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.
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".