"It's magical," Obama said, walking down a ramp alone, his hands in his pockets. "It reminds you of the sweep of history and our time here on earth is not that long. We better make the best of it."
A must-see for presidents from President Richard Nixon on, the Great Wall was one of Obama's major sightseeing stops during his diplomatic tour of Asia. He later traveled to Seoul, South Korea, the final stop of his eight-day trip.
Dressed in a winter jacket against a biting wind at the Great Wall, Obama led a knot of people for a half-hour jaunt up the crenelated wall toward a watchtower, a restored section originally built 500 years ago.
Obama walked down the last ramp by himself in a choreographed moment for photographers. White House aides were exultant afterward that "the shot" they had planned turned out perfectly.
The earliest sections of the wall were built more than 2,000 years ago. From the portion where Obama stood, the mountainside vistas were majestic.
Obama's tourism breaks at the Great Wall and the Forbidden City's former imperial palaces on Tuesday were the only diversions on an eight-day Asia trip meant to show U.S. reengagement with the region.
Obama sought to reassure allies in Japan and Southeast Asia - a mission he would continue in South Korea later Wednesday. In China, he tried to lend positive momentum to relations with the new world power and potential rival.
Stops at landmark tourist sites used to be - and often still are - compulsory for foreign dignitaries visiting China. Nixon's foreign affairs strategist Henry Kissinger suspected his Chinese hosts scheduled sightseeing to drag out his time - and perhaps drag out concessions.
History matters to the Chinese, who take pride in being heirs to a civilization of 4,000-plus years and believe the past offers insights into their present.
The head of China's legislature, Wu Bangguo, told Obama on Monday, "In China, there is a saying that if you want to appreciate the history of China in the past 100 years, go to Shanghai; in the past 1,000 years, come to Beijing; and for the past 2,000 years, go to Xi'an" - the imperial capital of China's first emperor and later dynasties.
Obama replied that he was impressed with the dynamism of Shanghai, where he held a town hall-style meeting with Chinese youth Monday and which, he said, is "a sign of China's emergence as a great economic power." His rapid 30-minute run through the vast Forbidden City on Tuesday was "a reminder of the incredible traditions and heritage of the Chinese people."
After the Wall, Obama headed for South Korea, his first visit to the country. How to coax nuclear-armed North Korea to return to disarmament talks is the top issue for Obama's meetings Thursday with South Korean President Lee Myung-bak in the capital, Seoul.
A longtime U.S. ally whose president is strongly pro-U.S., South Korea looks in many ways like the easiest part of Obama's Asia's swing.
Obama and Lee have taken a skeptical view of North Korea's recent conciliatory rhetoric to resume negotiations over its nuclear program, only weeks after it exploded a nuclear test-device and test-fired missiles. Last week, the North and South Korean navies skirmished in disputed waters for the first time in seven years, sending a North Korean patrol boat retreating in flames.
The clash was a reminder that the Korean Peninsula remains a volatile flash-point for the United States, which fought North Korean and Chinese forces to a standstill in the 1950-53 Korean War.
AP White House correspondent Jennifer Loven contributed to this report.