1038, Li Yuanhao, king of Xixia, acceded to the throne, and named the daughter of General Ye Li, who met begging, as the "Queen of Xiancheng". Later, Nanmouhui Palace was built in Xi 'an, Haiyuan, and the Tiandu Mountain Grottoes were expanded again and accepted as the royal temples of Xixia.
Haiyuan county is the frontier area of Xixia kingdom, and it is connected with Xiaoguan in the south. It is also the outpost of attacking the Song Dynasty and the gateway to the Central Plains. Every time Xixia attacked the Song Dynasty, one of the important contents was to go to Buddhist temples to burn incense and worship Buddha.
According to historical records, Li Yuanhao "married a woman for Prince Ninglingge without changing her surname, but she was very satisfied with her beauty. She was named "the new queen" and lived in Tiandu Mountain. And there are seven halls built in the palace, which are very magnificent and are equipped with precious houses. " As a result, the internal disputes of Xixia royal family continued, and the deposed queen, General Ye Li, was killed. The father and son turned against each other and killed each other, instead of hiding and usurping power, and the grand strategy of Xixia's entry into the central plains was shattered.
Tiandu Mountain Grottoes, which have experienced thousands of years of vicissitudes, have been robbed, destroyed by wars and earthquakes and rebuilt several times. The original bronze Buddha statue has been completely destroyed. The most serious thing is that during the copper smelting in 1958 Great Leap Forward, the trees around the temple were cut down and the temple was in ruins. The cave group reshaped the Buddha statue, integrating Buddhism, Taoism and Confucianism. In order to commemorate the Christmas of the boundless ancestor, a grand temple fair is held on the eighth day of April every year for three days. At that time, good men and women would face the mountains one after another. 1989 was named "Tiandu Mountain Taoist Temple" by the County Religious Affairs Bureau, and it is a municipal-level cultural relics protection unit in zhongwei.