Two giant drums were hoisted into the sky with two pairs of suspended drummers thumping out a hypnotic beat.
Thousands of athletes poured in from all four corners of the stadium, blowing kisses and waving flags.
The handover to London was worked into the ceremony, with David Beckham, the UK football star, kicking a football from a red double decker bus that unfolded into a silhouette of London.
Away from the stadium, crowds of people were also celebrating the games at the Tiananmen Square in the heart of Beijing.
Jacques Rogge, president of the International Olympics Committee, officially closed the games, praising China for an “impeccable” operation that had set the bar very high for London.
China also led the gold medal count at the games, winning 51 gold medals and 100 medals over all. The US picked up 110 medals overall, but won only 36 golds.
But China’s Olympics were also marked by the pro-Tibetan protests held around the world in the build up to the games, although such protests were limited during the games themselves.
Rights groups have also stressed that China had failed to live up to all of its Olympics commitments – notably in allowing freedom of expression to protesters.
“It has been very controlled by the authorities in Beijing, but I think there was a sense of openness,” Tony Cheng, Al Jazeera’s Beijing correspondent, said.
“A lot of the people who have come from around the world seemed to have a very good time. The reception from around the world seemed to be very good as well, so it hasn’t appeared as staged as I think people feared before the games started.”
He said that with the games behind them, the Chinese authorities would need to focus on China’s social and economic problems.
“It is going to leave a void – there will be an Olympic hangover, especially because China faces some pretty big challenges in the next six months,” he said.
“The economy is not expected to see the dynamic growth it has seen in the past decade, there’s going to be the fallout from the Szechuan earthquake – still a million people homeless, so those are going to be enormous challenges.”
China spent $43bn on the games, making it the most expensive sporting event ever.
Around $100m was spent on the opening and closing ceremonies alone.