Heian-kyo: A City Built Inside a Barrier
Takahiro Mitsui's thesis: the move to Heian-kyo in 794 was the court fleeing for its life from an unbearable curse; before the city was raised, onmyoji laid down kekkai in every direction, and only within those unseen walls was the capital built.
Fleeing a curse
Behind the incessant capital relocations that had kept the court wandering across the Nara Basin lay a single terrifying driver: tatari (祟り)—the retributive curse of vengeful spirits. While the imperial house is viewed today as a serene emblem of cultural continuity, its history was fraught with bloody struggles over succession. Along the way, rivals were assassinated, dynasties subverted, and usurpations attempted, each violent act leaving behind deep dread of vengeance from the dead. Tatari is an indispensable key to interpreting ancient Japan; its manifestations ranged from mysterious royal illnesses and political chaos to famine, crop failure, pestilence, sudden climate shifts, and foreign incursions. Neutralizing these curses was a matter of existential survival.
Amid this cycle of murder and dynastic bloodshed, the appearance of an exceptionally venomous spirit pushed the imperial house to the brink, forcing them to abandon the Nara Basin where they had flourished for centuries and flee in search of a new home. This was the true impetus behind the relocation to Heian-kyo in 794: the court was fleeing for its life from an unbearable curse. In this crisis, it was the Hata clan who stepped forward, offering the court a complete package that included the immense funding required for the move and the magical fortifications needed to ward off the curse, cementing their position as the supreme fixers behind the new capital.
The move to Heian-kyo, that is, was not only political. It was also a way of escaping the influence of the spirits that assassinations and betrayals had made. To pacify them in the new capital, the imperial house and court poured large sums into Shinto practitioners and Buddhist monks, but the results were not what they hoped, and they seem to have been looking for a gifted man who could build a kekkai (結界), a barrier that would keep vengeful spirits out of Heian-kyo.
The unseen threat and the Onmyoryo
What mattered most gravely to them, therefore, was not the trouble of the visible world. It was the shadow of death: unseen plagues and famines, and the onryo (怨霊) — vengeful spirits born of resentment and curses.
The Onmyoryo was the government bureau that housed officials versed in onmyodo (陰陽道) — the Way of Yin and Yang, a body of knowledge forged from the yin-yang and five-phases doctrines that had arisen and merged early on in ancient China. Far from being a superstitious office of fortune-telling and spell-casting, it was — to put it in terms of the modern American state — a supreme national intelligence and crisis-management agency combining the functions of the National Weather Service, the CIA, and the CDC.
The true threat to people of that era lay in unseen forces such as vengeful spirits and curses, and for those in power — the imperial house and the court nobility, who took the tangible harm of such forces with the utmost seriousness — fighting this invisible enemy in earnest was a matter of life and death. Under Emperor Tenmu, therefore, the cutting-edge science of yin-yang and the five phases imported from China was adopted as the ruling philosophy of the state.
Kekkai before the city
The decisive point in building Heian-kyo, this new capital in Kyoto, is that before the city itself was raised, onmyoji (陰陽師) — masters of onmyodo — first laid down kekkai in every direction, and only within those unseen walls of protection was the capital built.
The onmyoji were not chanting magic spells. What they practiced was a thoroughly logical form of systems engineering for the invisible world: stretching an intricate kekkai across the microcosm of the capital, maintaining it day and night, and defending internal order against external chaos. … Through this, Heian-kyo gained the strength to overcome the old fragility, rising again and again across centuries of upheaval. This, I believe, is the single greatest reason Kyoto has held its historical continuity down to the present day.
The demon gate and Enryaku-ji
In the northeast, the direction that ancient China treated as a problem, the "demon gate" through which calamity and demons enter, Enryakuji on Mount Hiei of the Tendai school was built and set as the absolute guardian of the imperial family and nobles of Heian-kyo. Among the Buddhist schools already spreading in Japan, the guardian that was the pivot of Heian-kyo was played strongly by Mount Hiei, which held Tendai, the esoteric school that was newest when the capital moved. At the same time the design of the city at its foot was not Buddhist. A specialist group built an invisible world from onmyodo (陰陽道), which has its roots in Taoism, and set up barriers on all four sides. Heian-kyo's urban design has a layered structure: Mount Hiei, as the absolute authority of esoteric guardianship, in the northeast, and the four sides of the city guarded by onmyodo.
Originating in China, the idea of the kimon gained tremendous currency through onmyodo (陰陽道), the way of yin and yang that flourished in the Heian period. Pointing to the northeast, it was, as the characters "demon gate" suggest, dreaded as the direction through which oni and catastrophic evils entered. Looked at from Heian-kyo in 794, the northeast was Mount Hiei; by placing Enryaku-ji there, Saicho, who maintained intimate ties with the imperial court, cast the temple as the spiritual guardian of the capital. Because it had been entrusted with defending the kimon, the most vital spiritual safeguard of Heian-kyo, Enryaku-ji's ascent was all but guaranteed.
The money for the move
From the assassination of Tanetsugu to the ill omen of Sawara's vengeful spirit, Kanmu's regime was shaken, and in 792 Nagaoka-kyo was struck by a great flood that left it unable to function. At the time there was a strong belief that such calamities came from the conduct of the leaders, and Kanmu's treatment of Sawara was above all called into question. They could not go back to Heijo-kyo. Yet they had no money to abandon Nagaoka-kyo and move to a new place. For Kanmu's side, literally choking on its debts, moving the capital to a land far from the strong influence of Heijo-kyo and renewing every system was a matter of life and death. The key was securing the budget.
Kanmu's side could not raise this budget alone, and it needed a new source of funds that did not depend on the Nara powers. The one who came forward to offer funds to Kanmu's side was a clan that held, in effect, the whole of what is now Kyoto. The clan was called the Hata.
Essays to read
- Silence is built within — Where do you find silence? Takahiro Mitsui argues not in the world but within, as a firewall around your own consciousness — and how the onmyoji first laid down kekkai, unseen walls of protection, around Heian-kyo.
- Behind every capital stand its fixers — A capital's quiet fixers fund and fortify it, Takahiro Mitsui shows: the Hata clan gave a court fleeing a curse the money and the magic to move.
- A capital designed to guard itself — Heian-kyo was designed with Mount Hiei and onmyodo barriers to guard itself, Takahiro Mitsui shows, yet lost its function when the old forces fell — the demon gate in the northeast, where Mount Hiei stood guard.
- When temples took up arms — A religion that wins worldly power arms itself, Takahiro Mitsui shows, and the court that cannot restrain it hands power to warriors — and the kimon, the demon gate Enryaku-ji was placed to guard.
- The seven years history lost — Kukai vanished from the record for seven years and came back with wealth and fluent Chinese; Takahiro Mitsui asks where great figures come from.
- A holy route may be a search — Behind the Shikoku pilgrimage, Takahiro Mitsui notes, Kukai may have been searching for something at someone's request in a regime shaken by calamity — Nagaoka-kyo, Prince Sawara's vengeful spirit and the flood of 792.