In the Kamakura period, Buddhism spread to the Samurai class, with temples being constructed in which to pray for the prosperity and safety of the head of each territory as well as the entire family, and these eventually became integrated with temples founded to pray for the souls of those family members who died in battle.
鎌倉時代になると、仏教信仰が武士にも広まり、各武士の所領に当主や一族の繁栄や無事を祈る祈願寺が建立され、やがて戦死した一族を祀る菩提寺と一体化した。