It was first founded during the Sui dynasty, but later rebuilt severalt times, notably between 1510 and 1513 by Ming dynasty emperor Emperor Zhengde.