Although archaeological evidence places the first human settlement on the islands of Japan to approximately 10,000 BC, relatively little is known about human activity in the area before the 6th century AD, 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, the Emperor chose to relocate the capital to a region far from the Buddhist influence. Emperor Kammu selected the village of Uda, at the time in the Kadono district of Yamashiro Province, for this honor.
The new city, Heian-ky?, 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. (Some believe that it is still a legal capital: see Capital of Japan.)
The city suffered extensive destruction in the ?nin War of 1467-1477, and did not really recover until the mid-16th century. 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 late 16th century, Toyotomi Hideyoshi restructured 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 circulating the city. Teramachi Street in central Kyoto is a Buddhist temple quarter where