When Douryo, pupil of Ryoan-emyo-zenji, heard that the master builds SAIJOJI, he changed into TENGU and flew over from Mii-temple of Omi in Shiga-prefecture to help to bulid the temple by burying a valley using supernatural powers and by lifting rocks and breaking them.
And then Ryoan-emyo-zenji died at 75 years old, it is said that he changed into TENGU and flew away into deep of the mountain to protect the temple forever. Since then TENGU is deified a guardian deity of the temple.