Until the Meiji Restoration, the area of Kyoto Prefecture was known as Yamashiro.
For most of its history, the city of Kyoto was Japan's Imperial capital. The city's history can be traced back as far as the 6th century. In 544, the Aoi Matsuri was held in Kyoto to pray for good harvest and good weather.
Kyoto did not start out as Japan's capital. A noteworthy earlier capital was Nara. In 741, Emperor Shōmu moved the capital briefly to Kuni-kyo, between the cities of Nara and Kyoto, in present-day Kyoto Prefecture. In 784, the capital was moved to Nagaokakyō, also in present-day Kyoto Prefecture. In 794, Emperor Kanmu moved the capital to Heian-kyo, and this was the beginning of the current-day city of Kyoto. Even today, almost all of the streets, houses, stores, temples and shrines in Kyoto exist where they were placed in this year.
Although in 1192 real political power shifted to Kamakura, where a samurai clan established the shogunate, Kyoto remained the imperial capital as the powerless emperors and their court continued to be seated in the city. Imperial rule was briefly restored in 1333, but another samurai clan established a new shogunate in Kyoto three years later.
In 1467, a great civil war, the Ōnin War, took place inside Kyoto, and most of the town was burned down. Japan plunged into the age of warring feudal lords. A new strong man, Tokugawa Ieyasu, established the shogunate at Edo (today's Tokyo) in 1603.
In the 15th century AD, tea-jars were brought by the shōguns to Uji in Kyoto from the Philippines which was used in the Japanese tea ceremony.
The Meiji Restoration returned Japan to imperial rule in 1868. Emperor Meiji, who was now the absolute sovereign, went to stay in Tokyo during the next year. The imperial court has not returned to Kyoto since then. During the instigation of Fuhanken Sanchisei in 1868, the prefecture received its suffix fu. The subsequent reorganization of the old provincial system merged the former Tango Province, Yamashiro Province and the eastern part of Tanba Province into today's Kyoto Prefecture.
Although many Japanese major cities were heavily bombed by U.S. bombers during World War II, the old capital escaped such devastating bombing. During the occupation, the U.S. Sixth Army was headquartered in Kyoto.