At the fall of the shogunate in the 14th century, the Edo clan took the side of the Southern Court, and its influence declined during the Muromachi period.
Tokugawa Ieyasu emerged as the paramount warlord of the Sengoku period following his victory at the Battle of Sekigahara in October 1600.
Edo grew from a fishing village in Musashi Province in 1457 into the largest metropolis in the world, with an estimated population of 1 million by 1721.
Reconstruction efforts expanded the city east of the Sumida River, and some daimyō residences were relocated to give more space to the city, especially in the immediate vicinity of the shogun's residence, creating a large green space beside the castle, now the Fukiage gardens of the Imperial Palace.
On the east and northeast sides of the castle lived the Shomin (庶民, "regular people") including the chōnin in a much more densely populated area than the samurai class area, organized in a series of gated communities called machi (町, "town" or "village").
A path and a canal, a short distance north of Sensō-ji, extended west from the Sumida riverbank leading along the northern edge of the city to the Yoshiwara pleasure district.
Danzaemon, the hereditary position head of eta, or outcasts, who performed "unclean" works in the city resided nearby.
Temples and shrines occupied roughly 15% of the surface of the city, equivalent to the living areas of the townspeople, with however an average of one-tenth of its population.
The upper residence also acted as the representative embassy of the domain in Edo, connecting the shogunate and the clan.
The shogunate did not exercise its investigative powers inside the precincts of the residential estate of the upper residence, which could also act as a refuge.
The hatamoto samurais, in direct service of the Shogun, would have their own residences, usually located behind the castle on the Western side in the Banchō area.
The shonin population mainly lived in semi-collective housings called nagaya (長屋, litt.
"Long house"), multi-rooms wooden dwellings, organized in enclosed machi (町, "town" or "village"), with communal facilities, such as wells connected to the city's fresh water distribution system, garbage collection area and communal bathrooms.
Two floor buildings and larger shops, reserved to the higher-ranking members of the society, were facing the main street.
Very narrow streets accessible through small gates called roji (路地), would enter deeper inside the machi, where single floor nagayas, the uranagayas (裏長屋, litt.
The Machi-bugyō (町奉行) were samurai (at the very beginning of the shogunate daimyōs, later hatamoto) officials appointed to keep the order in the city, with the word designating both the heading magistrate, the magistrature and its organization.
They were in charge of Edo's day-to-day administration, combining the role of police, judge and fire brigade.
The geographical jurisdiction of the Machi-Bugyō did not exactly coincide with the Gofunai, creating some complexity on the handling on the matters of the city.
The Machi-bugyō oversaw the numerous Machi where shonin lived through representatives called Machidoshiyori (町年寄).