The Palace of Heavenly Purity was built in the early fifteenth century as the emperor's principal residence. Having been rebuilt several times after conflagrations, the current building is datable to 1798, the third year of the Jiaqing reign (1796-1820).
From the Yongle Emperor (r. 1403-1424) of the Ming dynasty (1368-1644) to the early Qing dynasty (1644-1911), the Palace of Heavenly Purity was the place where emperors slept and worked. Their coffins were held in this palace before burial for several days of a ritual procedures and demonstrating a man's peaceful death in his own place. Beginning in the Yongzheng reign (1723-1735), the Palace of Heavenly Purity was no longer a residence. The nearby Hall of Mental Cultivation (Yangxin dian) took over that function. However, it still a venue in which emperors conducted routine government business and celebrated major festivals and rituals. "Banquets for a thousand elders" (qiansou yan) were held here in the Kangxi and Qianlong reigns.
Hanging high above the throne is a rubbing of the signboard inscription with "Upright and Pure in Mind" (Zhengda guangming) by the Shunzhi Emperor (r. 1644-1661). The Yongzheng Emperor initiated the custom of placing the name of the heir apparent in a box that was hidden behind this panel. The emperor also carried the designated heir's name. Upon the old emperor's death, the names were compared and, when satisfactorily confirmed, the successor declared.