Built in the 1400s, the Forbidden City once was home to 24 Chinese emperors who ruled the country for nearly 500 years, between 1420 and 1911. The former imperial palace is now known as the Palace Museum, and is open to Beijing's visitors.
"It's a testament to the greatness of Chinese history," said Mr. Obama, who had changed from his suit and tie into a sweater and brown shearling jacket to head out into Beijing's frigid weather. Snow dotted roofs, and the courtyards had patches of ice. Mr. Obama kept his hands in his pockets to ward off the chill.
Mr. Obama said the Forbidden City was "a magnificent place to visit." He said he wanted to come back with his wife, first lady Michelle Obama, and their two girls, Malia and Sasha. Mrs. Obama did not accompany the president on the trip.
He said Shanghai, the Forbidden City and the Great Wall were must-see stops for him this time, but that next time he hoped to visit other parts of the vast country.
Shanghai was Mr. Obama's first stop in China. His sightseeing was to continue Wednesday with a tour of the Great Wall.
Before concluding his visit to the Forbidden City, Mr. Obama wrote at length in the VIP visitor's book. The White House did not immediately disclose what he wrote.