Until the Meiji edict ordering the separation of Buddhism and Shinto, Buddhist temples and Shinto shrines (Buddhist deities and Shinto Kami) were worshipped as single entities and treated in the same manner unless there was a need to make a distinction.
寺院も神社も（神も仏も）信仰の対象としては変わりなく、明治の神仏分離令以前は、特に区別する必要が無ければ両方含めて扱われることも多かった。