The cult of Hachiman or “Hachimanism” is discussed from its inception as a national cult (mid-eighth century) to its firm establishment in the ninth century. Hachimanism was initially part of the politico-religious program of Emperor Shōmu and his daughter Abe, the “last empress”. Their kind of state Buddhism implied a combination of Buddhist ritualism based on the Golden Light Sutra and other state protecting Buddhist texts as well as non-Buddhist ancestor worship. Hachiman functioned according to both systems, since he was both a protector of Buddhism and an imperial ancestral deity. After what I call a Hachiman boom from about 750 to 770, the famous Dōkyō incident (769) must have led to a fundamental doubt in the validity of Hachiman's oracles and therefore to a crisis for Hachimanism. However, in the early Heian period, innovative monks such as Kūkai, Saichō, and Gyōkyō re-established Hachimanism to strengthen their ties to the imperial court. In order to obtain protection by the state they redefined the cult of Hachiman as an explicitly Buddhist state protector.