“From earliest times Hachiman, the Japanese Mars, has been the deity specially worshipped by warriors and the military classes, the original dedication of the shrine receding through the centuries to fabulous antiquity.
“The first temple of Hachiman to be erected in Kamakura was of less imposing proportions and upon a considerably smaller scale than it assumed later … [I]n March 1191, a disastrous conflagration occurred in Kamakura and the [original] buildings of Hachiman were entirely destroyed. After this fire, Yoritomo caused the shrine of his patron god to be rebuilt in its present commanding situation. This was so speedily accomplished that the main temple and all the vassal buildings were completed within the year … The temple was again attacked by fire in 1821 and again dstroyed. On this occasion, it was rebuilt and reestablished under the auspices of the 11th Tokugawa shogun, Ienari, the present structure dating from 1828.”
– Kamakura: Fact and Legend, by Iso Mutsu, 1985
From the wiki: “Throughout the Japanese medieval period, the worship of Hachiman [god of archery and warriors] spread throughout Japan among not only samurai, but also the peasantry. So much so was his popularity that presently there are 25,000 Shinto shrines in Japan dedicated to Hachiman, the second most numerous after shrines dedicated to Inari [rice god].
“Until the issuing of the Shinto and Buddhism Separation Order in 1868, during the time of the Restoration, Tsurugaoka Hachiman-gu served as both a Shinto shrine and Buddhist temple. It is, today, considered the most important Shinto shrine in Kamakura, the old capital where Nichiren Buddhism was introduced into Japan, and Kamakura is a city still filled with many holy icons representing both beliefs.”