Kyoto City   伏見稲荷大社

Although archaeological evidence suggests human settlement in Kyoto began as early as the Paleolithic period, relatively little is known about human activity in the area before the 6th century, around which time the Shimogamo Shrine is believed to have been established.During the 8th century, when powerful Buddhist clergy became involved in the affairs of the Imperial government, Emperor Kanmu chose to relocate the capital in order to distance it from the clerical establishment in Nara. His last choice for the site was the village of Uda, in the Kadono district of Yamashiro Province.

The new city, Heian-kyō (平安京, "tranquility and peace capital"), a scaled replica of the then Tang capital Chang'an, became the seat of Japan's imperial court in 794, beginning the Heian period of Japanese history. Although military rulers established their governments either in Kyoto (Muromachi shogunate) or in other cities such as Kamakura (Kamakura shogunate) and Edo (Tokugawa shogunate), Kyoto remained Japan's capital until the transfer of the imperial court to Tokyo in 1869 at the time of the Imperial Restoration.

The city suffered extensive destruction in the Ōnin War of 1467–1477, and did not really recover until the mid-16th century. During the Ōnin War, the shugo collapsed, and power was divided among the military families. Battles between samurai factions spilled into the streets, and came to involve the court nobility (kuge) and religious factions as well. Nobles' mansions were transformed into fortresses, deep trenches dug throughout the city for defense and as firebreaks, and numerous buildings burned. The city has not seen such widespread destruction since.

In the late 16th century, Toyotomi Hideyoshi reconstructed the city by building new streets to double the number of north-south streets in central Kyoto, creating rectangle blocks superseding ancient square blocks. Hideyoshi also built earthwork walls called odoi (御土居) encircling the city. Teramachi Street in central Kyoto is a Buddhist temple quarter where Hideyoshi gathered temples in the city. Throughout the Edo period, the economy of the city flourished as one of three major cities in Japan, the others being Osaka and Edo.

Modern Kyoto: The Hamaguri rebellion of 1864 burnt down 28,000 houses in the city which showed the rebels' dissatisfaction towards the Tokugawa Shogunate. The subsequent move of the Emperor to Tokyo in 1869 weakened the economy. The modern city of Kyoto was formed on April 1, 1889. The construction of Lake Biwa Canal in 1890 was one measure taken to revive the city. The population of the city exceeded one million in 1932.

There was some consideration by the United States of targeting Kyoto with an atomic bomb at the end of World War II because, as an intellectual center of Japan, it had a population large enough to possibly persuade the Emperor to surrender. In the end, at the insistence of Henry L. Stimson, Secretary of War in the Roosevelt and Truman administrations, the city was removed from the list of targets and replaced by Nagasaki. The city was largely spared from conventional bombing as well, although small-scale air raids did result in casualties. As a result, the Imperial City (Emeritus) of Kyoto is one of the few Japanese cities that still have an abundance of prewar buildings, such as the traditional townhouses known as machiya. However, modernization is continually breaking down the traditional Kyoto in favor of newer architecture, such as the Kyōto Station complex.

Kyoto became a city designated by government ordinance on September 1, 1956. In 1997, Kyoto hosted the conference that resulted in the protocol on greenhouse gas emissions.