As with most Shinto shrines of ancient origin, the story of the shrine's founding is vague, contradictory and lacking in historical documentation. According to the shrine's own myth, it was founded by order of
Empress Kōgyoku in 658 AD. The principal
kami, Ōhiko-no-mikoto was the son of the semi-legendary
Emperor Kōgen (reigned 214 to 157 BC). Per the
Nihon Shoki and
Kojiki, he was a general sent to conquer the
Hokuriku region for Yamato, and was the ancestor of the
Abe clan. After his return to Yamato, he was granted estates in the Asai District of Iga Province, where he eventually died and was buried in a
kofun (megalithic tomb). The secondary
kami,
Sukunabikona is connected with the immigrant
Hata clan, who were also living in this area. The shrine was originally located on the summit of Mount Nangū to the south, and was later relocated to its present site at the foot of the mountain. During the
Heian period, another secondary
kami, Kanayamahime, from the
Nangū Taisha in
Gifu Prefecture was moved to the old shrine at the summit of the mountain, hence where the name "Mount Nangū" originated. In the second year of the Jōgan Era (977 AD) mysterious words appeared, burned into the
shinboku of the shrine at the summit. According to the words, Kanayamahime had moved to Aekuni Shrine at the foot of the mountain. The shrine is listed in the
Nihon Montoku Tennō Jitsuroku of 850 AD,
Nihon Sandai Jitsuroku of 864 AD and the
Engishiki records of 927 AD, and in the late Heian period
Genpei Jōsuiki, it is called the "Ichinomiya Nangū Dai-Bosatsu". During the
Nanboku-cho period,
Southern Court Emperor Go-Murakami spent several days at the shrine and awarded it with an estate. However, during the 1579
Tenshō Iga War, the shrine was burned down by the forces of
Oda Nobunaga. It was reconstructed in 1593 by
yamabushi. In the
Edo period, with construction of
Iga Ueno Castle, the shrine was reconstructed in 1621 by order of
Tōdō Takatora, as it protected the spiritually vulnerable northeast quadrant of the castle. After the
Meiji restoration, the shrine was given the rank of in the
Modern system of ranked Shinto shrines in 1884. It is believed that part of the original worship around Aekuni Shrine was the worship of Mount Nangū itself, as 200 meters south of Aekuni Shrine is a large boulder believed to be the
iwakura (throne upon which the deity sits when it is worshiped). Currently, this boulder has been lost, however, a
kofun has been found in the vicinity, along with evidence of the enshrining of a certain large boulder. It is believed that this boulder is the one worshiped at Aekuni Shrine's
Oishi-sha. == Shrine structures ==