In the early 9th century, during the Heian Period, beginning with the relocation of the capital from Nagaoka-kyo to Heian-kyo prompted by Emperor Kanmu's constant fear of demons caused by frequent disasters and deaths around him after the assassination of FUJIWARA no Tanetsugu, belief in ghosts suddenly spread in and around the imperial court.
9世紀平安時代に入ると、藤原種継暗殺事件以降に身辺の被災や弔事が頻発したために悪霊におびえ続けた桓武天皇による長岡京から平安京への遷都に端を発して、にわかに朝廷を中心に怨霊である御霊信仰が広まった。