In the year 985, Tamemitsu lost both his wife and daughter, Emperor Kazan's court lady, and it is said that he founded a temple to pray for their happiness in the afterlife.
為光は985年(寛和元年）に妻と花山天皇の女御であった娘を相次いでうしなっており、その菩提を弔う目的でこの寺を創建したという。