"You have shown us the unifying power of sport," he told athletes in the National Stadium.
"The world learned about China - and China learned about the world," Rogge said.
"And now, in accordance with tradition, I declare the Games of the XXIX Olympiad closed, and I call upon the youth of the world to assemble four years from now in London to celebrate
the Games of the XXX Olympiad," he said.
The Games took place some three months after a devastating earthquake in China's Sichuan province, and the run up to the opening ceremony was dogged by pro-Tibet protests as the Olympic flame travelled the globe.
Rogge said earlier at a news conference that the most memorable moment for him was when the Russian and Georgian medal winners in the air pistol competition embraced each other despite fighting in South Ossetia. He said the best individual performances were by U.S. swimmer Michael Phelps and Jamaican sprinter Usain Bolt.
Phelps set a new Olympic record of eight gold medals. Bolt won three gold medals, in the 100m, 200m and 4 x 100m relay.
China won 51 gold medals, the most at the Games, plus 21 silver medals and 28 bronze medals as it reached exactly its target of 100 medals. The U.S. won more medals, with 110, but fewer golds (36-38-36). Russia came third with 72 medals - 23 gold, 21 silver and 28 bronze. Britain took fourth place with 47 medals (19-13-15).
The next Olympic Games will take place in London in 2012.
The closing ceremony saw Rogge hand over the Olympic flag to the mayor of London, Boris Johnson. English soccer star David Beckham also made an appearance and veteran British rock group Led Zeppelin played their song 'Whole Lotta Love' live on stage at the National Stadium before the Olympic flame was extinguished.