It was said the morning star (Venus) fell from the sky and Kokuzo Bosatsu appeared on the day that the vow made by the Nara period monk Dosho during a questioning ritual held on the site was fulfilled, and based on this legend, Myojo-sha Shrine was built to enshrine the lightning god Denden-Myojin as the embodiment of Myojo Tenshi who represents the star.
奈良時代の僧・道昌がこの地で行った求聞持法の満願の日に、空から明星が降りそそいで虚空蔵菩薩が示現したということから、その明星を表す明星天子を本地仏として、雷の神である電電明神を祀る明星社が鎮守社の一つとして作られた。