Heian-kyō
Heian-kyō (平安京; lit. 'peaceful/tranquil capital') was the imperial capital of Japan established by Emperor Kanmu in 794 in what is now Kyoto. It remained the seat of the Imperial Court for most of the following millennium. Japanese historical reference works treat it as formally remaining the capital until the Imperial Court and central government moved to Tokyo in 1869.
Heian-kyō was a planned rectangular city laid out on a grid based on the planning principles of Chinese imperial capitals, particularly Chang'an (modern Xi'an), the capital of Tang dynasty China. The Daidairi, containing the imperial palace and principal government offices, occupied the northern center of the city, while Suzaku-ōji formed its principal north–south axis.
From the late 12th century, effective political authority increasingly shifted to warrior governments, especially the Kamakura shogunate, while Kyoto remained the residence of the emperor and the Imperial Court. The western part of the planned capital declined and the inhabited city expanded northward and eastward, gradually developing into medieval Kyoto. By around 1220, Kyoto had largely superseded Heian-kyō as the usual name of the city.