Both internal and external factors led to the decline of the Tokugawa dynasty. By the nineteenth century, crop failure, high taxes, and exorbitant taxation created immense hardship. Many people starved as a result. Many farmers were forced to sell their land and become tenant farmers. In the cities, the price of rice and other commodities was so high that the poor had to go hungry. The Samurai and daimyo class suffered also, as they fell into debt. Rather than relieve the plight of the poor, the Tokugawa government, the bafuku, cancelled debts owed by the Samurai and daimyo, abolished a number of trade guilds, and compelled the peasants in the cities to return to the countryside and become farmers.
Additionally, Japan had attempted to isolate itself from the rest of the world, with only a few Dutch ships allowed to dock and trade there. Others were crucified as a warning to stay way. However, in 1853, Commodore Matthew Perry arrived with an American fleet, trained his guns on Tokyo, and demanded a "treaty of friendship" and trading rights. Since the buildings in Tokyo were made of paper and the American forces superior, the Shogun had no choice but to agree. The British, Russians and Dutch soon won similar treaties, all of which were quite unequal and disadvantageous to the Japanese government. The Emperor and conservative daimyo questioned the right of the Shogun to rule as the "subduer of the barbarian," and the cry to "preserve the Emperor, expel the barbarians" was soon heard in the streets. A brief civil war broke out, but the Tokugawa dynasty was doomed. In 1868 the Shogun resigned and the boy Emperor, Mitsuhito, known by his reign name of Meiji ("enlightened rule") became ruler of the country. This was the Meiji restoration.