The temple was founded in the 8th century. Its origins are historically unclear, but it is said that the Chinese priest Jianzhen initiated a disciple into the Buddhist path, who saw in a dream in 772 that Mt. Kurama had spiritual power and built an esoteric temple to concentrate and control this power. It was burned down many times throughout the medieval era but the Buddhist statues and treasures inside it were always rescued and are today National Treasures. It is still believed today that tengu and other mountain spirits live in this area.
The temple switched between three different Buddhist sects over the centuries. Finally, in the postwar era, abbot Kouun Shigaraki founded his own religion and split the temple away from Buddhism. Thus the temple was finally able to reconcile with its yamabushi patrons and other unaffiliated, esoteric adherents of mountain worship.