city's name have included Kioto and Miaco or Meaco. History Origins Ample archeological evidence suggests human settlement in the area of Kyoto began as early as the Paleolithic period, although not much published material is retained about human activity in the region 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, , modeled after Chinese Tang dynasty 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. Middle Ages In the Sengoku period, the city suffered extensive destruction in the Ōnin War of 1467–1477, and did not really recover until the mid-16th century. During the war, battles between samurai factions spilled into the streets, and came to involve 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 encircling the city. Teramachi Street in central Kyoto is a Buddhist temple quarter where Hideyoshi gathered temples in the city. Early modern period Throughout the Edo period, the economy of the city flourished as one of three major cities in Japan, the others being Osaka and Edo. At the end of the period, the Hamaguri rebellion of 1864 burned down 28,000 houses in the city, which showed the rebels' dissatisfaction towards the Tokugawa Shogunate. Modern period At the start of the Meiji period, the emperor's move from Kyoto to Tokyo in 1869 weakened the economy of Kyoto. The modern city