The late Tokugawa shogunate (Bakumatsu) was the period between 1853 and 1867, during which Japan ended its isolationist foreign policy called sakoku and modernized from a feudal shogunate to the Meiji government. It is at the end of the Edo period and preceded the Meiji era. The major ideological and political factions during this period were divided into the pro-imperialist Ishin Shishi (nationalist patriots) and the shogunate forces, including the elite shinsengumi ("newly selected corps") swordsmen.
Although these two groups were the most visible powers, many other factions attempted to use the chaos of the Bakumatsu era to seize personal power. Furthermore, there were two other main driving forces for dissent; first, growing resentment of tozama daimyōs, and second, growing anti-Western sentiment following the arrival of a United States Navy fleet under the command of Matthew C. Perry (which led to the forced opening of Japan). The first related to those lords who had fought against Tokugawa forces at Sekigahara (in 1600) and had from that point on been exiled permanently from all powerful positions within the shogunate. The second was to be expressed in the phrase sonnō jōi ("revere the Emperor, expel the barbarians"). The end for the Bakumatsu was the Boshin War, notably the Battle of Toba–Fushimi, when pro-shogunate forces were defeated.