In the 5th century, the Hata clan immigrated to Japan where they settled in Yamashiro Province and took the Mt. Matsuo kami (Oyamakuino-kami) as their ujigami (guardian deity).
5世紀ごろ、渡来人の秦氏が山城国一帯に居住し、松尾山の神（大山咋神）を氏神とした。