section_path: History/Pre-1869 (Edo period)
section_name: Pre-1869 (Edo period)
paragraph_text: Pre-1869 (Edo period)
  
  Tokyo was originally a village called Edo, part of the old Musashi Province. Edo was first fortified by the Edo clan in the late twelfth century. In 1457, Ōta Dōkan built Edo Castle to defend the region from the Chiba clan. After Dōkan was assassinated in 1486, the castle and the area came to be possessed by several feudal lords. In 1590, Tokugawa Ieyasu was granted the Kantō region by Toyotomi Hideyoshi and moved there from his ancestral land of Mikawa Province. He greatly expanded the castle, which was said to have been abandoned and in tatters when he moved there, and ruled the region from there. When he became shōgun, the de facto ruler of the country, in 1603, the whole country came to be ruled from Edo. While the Tokugawa shogunate ruled the country in practice, the Imperial House of Japan was still the de jure ruler, and the title of shōgun was granted by the Emperor as a formality. The Imperial House was based in Kyoto from 794 to 1868, so Edo was still not the capital of Japan. During the Edo period, the city enjoyed a prolonged period of peace known as the Pax Tokugawa, and in the presence of such peace, the shogunate adopted a stringent policy of seclusion, which helped to perpetuate the lack of any serious military threat to the city. The absence of war-inflicted devastation allowed Edo to devote the majority of its resources to rebuilding in the wake of the consistent fires, earthquakes, and other devastating natural disasters that plagued the city. Edo grew into one of the largest cities in the world with a population reaching one million by the 18th century.
  
  This prolonged period of seclusion however came to an end with the arrival of American Commodore Matthew C. Perry in 1853. Commodore Perry forced the opening of the ports of Shimoda and Hakodate, leading to an increase in the demand for new foreign goods and subsequently a severe rise in inflation. Social unrest mounted in the wake of these higher prices and culminated in widespread rebellions and demonstrations, especially in the form of the "smashing" of rice establishments. Meanwhile, supporters of the Emperor leveraged the disruption caused by widespread rebellious demonstrations to further consolidate power, which resulted in the overthrow of the last Tokugawa shōgun, Yoshinobu, in 1867. After 265 years, the Pax Tokugawa came to an end. In May 1868, Edo castle was handed to the Emperor-supporting forces after negotiation (the Fall of Edo). Some forces loyal to the shogunate kept fighting, but with their loss in the Battle of Ueno on 4 July 1868, the entire city came under the control of the new government.