Heian-kyō founded by Emperor Kanmu
Heian-kyō (平安京, lit. "peaceful/tranquil capital") was one of several former names for the city now known as Kyoto. It was the official capital of Japan for over one thousand years, from 794 to 1868 with an interruption in 1180.
Emperor Kanmu established it as the capital in 794, moving the Imperial Court there from nearby Nagaoka-kyō at the recommendation of his advisor Wake no Kiyomaro and marking the beginning of the Heian period of Japanese history. According to  modern scholarship, the  city is thought to  have been modelled after the urban planning  for the Tang dynasty Chinese capital of Chang'an (modern-day Xi'an). It remained the chief political center until 1185, when the samurai Minamoto clan defeated the Taira clan in the Genpei War, moving administration of national affairs to Kamakura and establishing the Kamakura shogunate.
Though political power would be wielded by the samurai class over the course of three different shogunates, Heian remained the site of the Imperial Court and seat of Imperial power, and thus remained the official capital. In fact, even after the seat of Imperial power was moved to Tokyo in 1868, since there is no law which makes Tokyo the capital, there is a view that Kyoto legally or officially remains the capital even today.
In 1994, Kyoto City held various events commemorating its 1200th anniversary.