In the time of Emperor Xiaowen of the Northern Wei Dynasty (late fifth century), a Buddhist temple stood on this spot. A stone pagoda was added in 602 and the name of the temple changed.