Hachiman (八幡神 Hachiman-jin or Yahata no kami) is a popular Shintō deity who protects warriors and generally looks after the well-being of the community. Since the Heian Period (794-1185) identified as the deified spirit of the legendary Emperor Ojin (応神天皇 Ōjin-tennō, the fifteenth emperor of Japan, he is worshiped as the central deity in Hachiman shrines (八幡神社 Hachiman-jinja or 八幡宮 Hachiman-gū), where he is usually flanked by two other deities, Empress Jingū (Okinaga-Tarashihime no Mikoto, the spirit of Ojin’s mother, the legendary Empress Jingū) and Hime-ōkami, Ojin’s spouse deified. The three deities together are sometimes collectively referred to as Hachiman.
The origins of Hachiman are unknown. The Chinese characters for the name, which can also be read Yahata, literally mean “eight banners,” which has been interpreted as referring to the legend that eight banners appeared from heaven at the birth of Emperor Ojin, who is associated with a legend concerning a successful campaign of conquest in Korea. More likely, however, is the theory that Yahata was merely the name of the region in the Usa district (Ōita Prefecture in Kyūshū, where the cult of this deity first arose.
Although the Fuso-ryakki (扶桑略記, Abridged Annals of Japan, twelfth century) states that the Usa-jingū, the earliest and foremost Hachiman shrine, was built in 571, the oldest attested reference to the shrine occurs in a chronicle (続日本紀 Shoku Nihongi) under the year 737, which suggests a relatively late origin. After an oracle declared that Hachiman would provide protection for the construction of the Great Buddha image (daibutsu) in Nara (749), he began to be viewed as a protector of Buddhism and was given the Buddhist title Daibosatsu (大菩薩, Great Bodhisattva). His cult became firmly established in Kyōto after the Iwashimizu Hachiman-gū (石清水八幡宮) in Yawata City, Kyōto Prefecture, a derivative shrine of the Usa-jingū, was built there in accordance with a petition in 859 by the Buddhist monk Gyōkyō.
Being identified with military prowess, Hachiman was adopted as the patron deity of the Minamoto family and subsequent other warrior clans. The main shrine to this deity in eastern Japan is the Tsurugaoka Hachiman-gū (鶴岡八幡宮) in Kamakura, established there in 1191 by Minamoto no Yoritomo, the founder of the Kamakura shogunate.
The popularity of the syncretic Hachiman cult has grown steadily, manifested by some 25,000 Hachiman shrines throughout Japan today.