Since Ogotoso was given to Ozuki Imao no Sukune in 851, Hoko-ji Temple, which was constructed as Uji-dera Temple (temple built for praying clan's glory), regarding this shrine and Ogoto-jinja Shrine as ujigami (a guardian god or spirit of a particular place in the Shinto religion), became the Betto-ji Temple (a temple attached to a shrine) for this temple.
仁寿元年（851年）、小槻宿禰今雄が雄琴荘を拝領して以降、当社と雄琴神社と氏神とし、氏寺として建立した法光寺が当社別当寺となった。