stylistic:tone, linguistic:voice_change
End of seclusion

When Commodore Matthew C. Perry 's four-ship squadron appeared in Edo Bay in July 1853, the bakufu was thrown into turmoil. The chairman of the senior councillors, Abe Masahiro (1819–1857), was responsible for dealing with the Americans. Having no precedent to manage this threat to national security, Abe tried to balance the desires of the senior councillors to compromise with the foreigners, of the emperor who wanted to keep the foreigners out, and of the daimyo who wanted to go to war. Lacking consensus, Abe decided to compromise by accepting Perry's demands for opening Japan to foreign trade while also making military preparations. In March 1854, the Treaty of Peace and Amity (or Treaty of Kanagawa) opened two ports to American ships seeking provisions, guaranteed good treatment to shipwrecked American sailors, and allowed a United States consul to take up residence in Shimoda, a seaport on the Izu Peninsula, southwest of Edo. The Treaty of Amity and Commerce Between the U.S. and Japan (Harris Treaty), opening still more areas to American trade, was forced on the bakufu five years later.

The resulting damage to the bakufu was significant. The devalued price for gold in Japan was one immediate, enormous effect. The European and American traders purchased gold for its original price on the world market and then sold it to the Japanese for triple the price. Along with this, cheap goods from these developed nations, like finished cotton, flooded the market forcing many Japanese out of business. Debate over government policy was unusual and had engendered public criticism of the bakufu. In the hope of enlisting the support of new allies, Abe, to the consternation of the fudai, had consulted with the shinpan and tozama daimyo, further undermining the already weakened bakufu. In the Ansei Reform (1854–1856), Abe then tried to strengthen the regime by ordering Dutch warships and armaments from the Netherlands and building new port defenses. In 1855, a naval training school with Dutch instructors was set up at Nagasaki, and a Western-style military school was established at Edo; by the next year, the government was translating Western books. Opposition to Abe increased within fudai circles, which opposed opening bakufu councils to tozama daimyo, and he was replaced in 1855 as chairman of the senior councilors by Hotta Masayoshi (1810–1864).

At the head of the dissident faction was Tokugawa Nariaki, who had long embraced a militant loyalty to the emperor along with anti-foreign sentiments, and who had been put in charge of national defense in 1854. The Mito school—based on neo-Confucian and Shinto principles—had as its goal the restoration of the imperial institution, the turning back of the West, and the founding of a world empire under the divine imperial house.

In the final years of the Tokugawas, foreign contacts increased as more concessions were granted. The new treaty with the United States in 1859 allowed more ports to be opened to diplomatic representatives, unsupervised trade at four additional ports, and foreign residences in Osaka and Edo. It also embodied the concept of extraterritoriality (foreigners were subject to the laws of their own countries but not to Japanese law). Hotta lost the support of key daimyo, and when Tokugawa Nariaki opposed the new treaty, Hotta sought imperial sanction. The court officials, perceiving the weakness of the bakufu, rejected Hotta's request and thus suddenly embroiled Kyoto and the emperor in Japan's internal politics for the first time in many centuries. When the shōgun died without an heir, Nariaki appealed to the court for support of his own son, Tokugawa Yoshinobu (or Keiki), for shōgun, a candidate favored by the shinpan and tozama daimyo. The fudai won the power struggle, however, installing Tokugawa Yoshitomi, arresting Nariaki and Keiki, executing Yoshida Shōin (1830–1859), a leading sonnō-jōi intellectual who had opposed the American treaty and plotted a revolution against the bakufu, and signing treaties with the United States and five other nations, thus ending more than 200 years of exclusion.

Recently some scholars have suggested that there were more events that spurred this opening of Japan. Yoshimune, eighth Tokugawa shōgun from 1716 to 1745, started the first Kyōhō reforms in an attempt to gain more revenue for the government. In 1767, to 1786 Tanuma Okitsugu also initiated some unorthodox economic reforms to expand government income. This led his conservative opponents to attack him and take his position as he was forced from government in disgrace. Similarly, Matsudaira Sadanobu launched the Kansei Reforms in 1787–1793 to stabilize rice prices, cut government costs, and increase revenues. The final economic reform of the Tenpō era of 1841–1843 had similar objectives. Most were ineffective and only worked in some areas. These economic failings would also have been a force in the opening of Japan, as Japanese businessmen desired larger markets. Some scholars also point to internal activism for political change. The Mito school had long been an active force in demanding political changes, such as restoring the powers of the Emperor. This anger can also be seen in the poetry of Matsuo Taseko (a woman who farmed silkworms in the Ina Valley) from Hirata Atsutane's School of National Learning:

"It is disgusting the agitation over thread In today's world Ever since the ships from foreign countries came for the jeweled silkworm cocoons to the land of the gods and the Emperor Peoples hearts awesome though they are, are being pulled apart and consumed by rage."

This inspired many anti-Tokugawa activists as they blamed the bakufu for impoverishing the people and dishonoring the emperor.