BEIJING - And for their final surprise, the Chinese laughed.
Formally ending an Olympics that were as much mystery as majesty, the host nation unfolded its arms, threw back its head and howled.
There were silly flying drummers, a human tambourine composed of thousands of shimmying women and unicyclists rolling giant glowing circles.
There were guns shooting confetti into the stands, gymnasts on stilts, and Power Ranger look-alikes.
In the closing ceremony, after two weeks of an Olympics run as sternly as the soldiers who stood guard, the Chinese finally let that guard down.
They allowed athletes to break human barriers and run around National Stadium screaming and waving what appeared to be bottles of booze. They let David Beckham kick a soccer ball into a crowd.
"Through these Games, the world learned more about China and China learned more about the world," said Jacques Rogge, International Olympic Committee president, in his closing address.
Those giant booms that filled National Stadium throughout the night were not only fireworks, but also Rogge's sighs of relief.
Placing one of the world's most important celebrations of brotherhood and peace in the hands of an authoritarian government was the biggest gamble in Olympic history. But the risk was worth it.
With clockwork precision, at least $40 billion and endless swarms of volunteers, these Olympics worked better than any in the modern era.
There was none of the usual competition controversy, none of the common logistical nightmares. The Games ran so smoothly that troubleshooting officials eventually canceled daily press briefings with no complaints because, well, there were no complaints.
"These were truly exceptional games," Rogge said.
They were also exceptional, however, for being played out against a political backdrop that was contrary to the very ideals that the Games promoted. Even as it was drawing worldwide praise for its Olympics, the Chinese government drew a rebuke from the U.S. Embassy yesterday after it refused to release at least 10 foreigners - including eight Americans - detained for staging Olympic protests.
And even as closing ceremony singers were crooning, "Beijing, Beijing, I Love Beijing," there was some question as to what exactly Beijing was. Even one of China's sports teams seemed fake, as all but one of the six gymnasts on their gold-medal winning team are being investigated by the IOC for being younger than the 16-year-old age minimum.
But somehow, the sports again rose above the muck, the Games not only surviving, but also flourishing, with the only controversy arising from sports pages.
So who won the medal race? Chinese newspapers ran charts that ranked the countries based on gold medals. In that race, China won, 51-36. Most U.S. newspapers ran charts that ranked the countries based on total medals. In that race, the United States won, 110-100.
Not that China's chart is right, but, well, China's chart is right. When it comes to every other professional sport, Americans don't count second or third place, so why now?
The real winners here were the fields of play, which were strong enough to provide a measure of comfort even in the wake of an off-the-field tragedy. On the first full day of competition, outside Beijing's historic Drum Tower, Todd Bachman, father-in-law of U.S. volleyball coach Hugh McCutcheon, was stabbed to death by a thief.
Yesterday, after the grieving coach eventually returned to his team, McCutcheon's inspired group won the gold with a stunning victory over Brazil.
Maybe in that fun closing ceremony, the Chinese showed that they really did learn something from the rest of the world.
Maybe they watched U.S. swimmer Michael Phelps shouting and fist-pumping his way to an Olympic-record eight gold medals. Maybe they watched Jamaican sprinter Usain Bolt do his joyful bolt dance after three gold medals.
Whatever, when it came time to wave goodbye, the host country did so with what seemed like genuine sharing and joy.
Maybe the Chinese are truly sorry the world is leaving what will be remembered as one of their great global achievements. Then again, maybe they're just glad to get rid of us.