The Heian period saw the rise of a belief that reposing these souls by restoring them to their former ranks or giving them posthumous names or court ranks, and deifying them as gods would encourage them to bring peace and stability to people in return as "goryo", chingo no kami (guardian gods).
こうした亡霊を復位させたり、諡号・官位を贈り、その霊を鎮め、神として祀れば、かえって「御霊」として霊は鎮護の神として平穏を与えるという考え方が平安期を通しておこった。