It was destroyed by fire during the Mongolian invasion of the 13th century. Monk Shi Wencui () restored and rebuilt the temple in 1345.