It is said that this shrine was founded by an emperor named Nintoku around the 3rd to 4th century and has been located at its current location since the year 938. An ancestor of the Kamakura shogunate, Minamoto no Yoshiie, visited here often, and so it could be said that the shrine reflects the strong religious faith of samurai.
In 1570, when Tokugawa Ieyasu was 29 years old, he moved to Hamamatsu Castle. It is said that the Hamamatsu Hachiman Shrine used to be located close to the castle and in the direction of “kimon.” When a shrine is faced in the direction of “kimon,” it is considered as a guardian of the castle near it, so Tokugawa Ieyasu worshipped there many times while he lived in Hamamatsu Castle.
In 1572, Tokugawa Ieyasu fought an army led by Takeda Shingen. It was one of Tokugawa Ieyasu’s worst defeats. In his escape from the chasing army, he hid inside a large camphor tree on the property of the Hamamatsu Hachimangu Shrine. The tree still exists and is considered as a “Goshinboku” (sacred object). The hole in the tree that Tokugawa Ieyasu used to hide in can still be seen.