During the Ming and Qing Dynasties, it was located in the center of the Imperial City. There were seven gates leading into the Imperial City, which was surrounded by a wall. It included historical sites such as the Forbidden City, Tiananmen, Zhongnanhai, Beihai, Zhongshan, Jingshan, Taimiao (Imperial Ancestral Temple) and Xiancantan.
After the fall of the Qing Dynasty in 1912, the Imperial City was taken over by the government of the People's Republic of China.
Zhongnanhai was transformed into the Presidential Palace for a time, and the Imperial Ancestral Temple became part of the Palace Museum. Beihai and Jingshan became public parks, and most of the former temples and other imperial buildings became private residences.
In 1949, some of the gates leading to the Imperial City and many of the buildings in the Imperial Garden were demolished. Zhongnanhai became the headquarters of the Chinese Communist Party. Most of the temples and many of the existing buildings were occupied by government agencies and private individuals.