The temple was built by Kobo Daishi Kukai when he founded Mount Koya in 816 and is also the family temple of the Tokugawa family.