During the Tokugawa period between 1600 and 1868, Japan was ruled by the Tokugawa samurai family. The shogun was the most powerful authority in the country, overshadowing the emperor, who continued to play a limited role as a legitimizer of warrior power. But the shogun shared government with more than 250 lords (daimyō), who had to declare fealty in exchange for permission to govern hereditary fiefs (domains) of various sizes. Each domain was able to issue its own laws and collect taxes. But lords had to spend about every other year in the shogunal capital of Edo, and many of them served in temporary roles in the shogunal administration.
The samurai constituted a hereditary ruling class during this period. Because Tokugawa Japan was domestically at peace, most samurai worked as administrators or security guards for a lord or the shogun. They were paid stipends funded by taxes that were primarily collected from rural producers. Over time, many samurai fell into debt as most of them were forced to live in towns and cities and had difficulty maintaining a status-appropriate standard of living on shrinking stipends. Many commoners, especially merchants, came to surpass samurai in terms of wealth and economic influence. Literacy was high by worldwide standards. Around the middle of the nineteenth century, about 70 percent of Edo residents were able to read at least simple texts written in the kana syllabary, and about 40-50 percent of Japanese men and 15 percent of women are estimated to have had some degree of literacy by 1870.
Although the vast majority of Japanese lived in the countryside and engaged in agriculture, cities and towns greatly expanded in the Tokugawa period and the Japanese population reached 30 million by the early 1700s. The shogunal capital of Edo (today Tokyo) as well as Osaka and Kyoto turned into large metropolises with powerful merchant houses and an advanced urban infrastructure and print culture. Together with smaller castle, port, and market towns, they became centers of vibrant commercial networks that circulated goods and money through the entire country. Trade and travel were facilitated by a well-developed highway system that was fast and reliable despite a ban on wheeled vehicles; only foot and packhorse traffic were allowed for overland transportation. In some places, the monetary economy led to the growth of proto-capitalist modes of production.
The Tokugawa shoguns heavily regulated Japan's contact with the outside world. Foreign trade, most of it with Korea and China, was allowed in only a handful of locations on the western and northern extremities of the empire. Among western empires, only the Dutch were allowed entry into Japan, and even they had to spend most of their time on a small island in the port of Nagasaki. The Tokugawa strictly prohibited Christianity, which was associated with evil, deceit, and foreign domination. But in 1854, American and Russian warships forced the shogunate to sign friendship treaties, and a few years later the shogunate had to conclude trade treaties with a number of Western nations. These treaties forced unfavorable trading conditions upon the country that threatened its independence in the long run, but they greatly increasing its contact with the outside world.
In 1868, the Tokugawa period came to an end when a coalition of lower-ranking samurai based in western domains forced the last Tokugawa shogun to resign and took control of the emperor as a new symbol of national unity. The new Meiji regime abolished the domains and the status order and gradually built a powerful unified nation state while borrowing from a variety of western models. It also heavily promoted industrialization, issued a Western-inspired constitution, built a modern military, and laid the groundwork for Japan as an imperialist power.