This temple was reportedly built in 810 by Kukai, and later received the devotion of Cloistered Emperor Goshirakawa, who built its cathedral and whose prince, Cloistered Imperial Prince Kakugyo, entered this temple as a priest.
この寺は、810年（弘仁元年）空海によって創建されたと伝えられ、その後白河法皇の帰依を得て伽藍の造営が行われ、白河法皇の皇子覚行法親王が入寺したという。