were the final years of the Edo period when the Tokugawa shogunate ended. Between 1853 and 1867, under foreign diplomatic and military pressure, Japan ended its isolationist foreign policy known as and changed from a feudal Tokugawa shogunate to the modern empire of the Meiji government. The major ideological-political divide during this period was between the pro-imperial nationalists called and the shogunate forces, which included the elite swordsmen.
Although these two groups were the most visible powers, many other factions attempted to use the chaos of to seize personal power. Furthermore, there were two other main driving forces for dissent: first, growing resentment on the part of the (or outside lords), and second, growing anti-Western sentiment following the arrival of Matthew C. Perry. The first related to those lords whose predecessors had fought against Tokugawa forces at the Battle of Sekigahara in 1600, after which they had been permanently excluded from all powerful positions within the shogunate. The second was to be expressed in the phrase , or "revere the Emperor, expel the barbarians". The turning point of the Bakumatsu was during the Boshin War and the Battle of Toba–Fushimi when pro-shogunate forces were defeated.
Background
Frictions with foreign powers
Frictions with foreign shipping led Japan to take defensive actions from the beginning of the 19th century. Western ships were increasing their presence around Japan due to whaling activities and the trade with China. They were hoping for Japan to become a base for supply or at least a place where shipwrecks could receive assistance. The incident in Nagasaki Harbour where the Royal Navy frigate HMS Phaeton demanded supplies from the harbour chief in 1808 shocked the Tokugawa government, who ordered the ports to be even more tightly guarded. In 1825, the was issued by the shogunate, prohibiting any contacts with foreigners; it remained in place until 1842.
thumb|A 150-pound [[Artillery of Japan|Satsuma cannon, built in 1849. It was mounted on Fort Tenpozan at Kagoshima. Caliber: 290 mm, length: 4220 mm]]
Meanwhile, Japan endeavoured to learn about foreign sciences through ("Western studies"). To reinforce Japan's capability to carry on the orders to repel Westerners, some such as the Nagasaki-based Takashima Shūhan managed to obtain weapons through the Dutch at Dejima, such as field guns, mortars and firearms. These domains also studied the manufacture of Western weapons. By 1852 Satsuma and Saga had reverberatory furnaces to produce the iron necessary for firearms. After the humiliating defeat suffered by Qing China in the First and Second Opium Wars, many Japanese officials realized that their traditional methods would be no match for western powers. To deal with Western powers on equal terms, Western guns were studied and demonstrations made in 1841 by Takashima Shūhan to the Tokugawa government. Egawa argued that just as Confucianism and Buddhism had been introduced from abroad, it made sense to introduce useful Western techniques.
After 1839, however, traditionalists tended to prevail. Students of Western sciences were accused of treason (), put under house arrest (Takashima Shūhan), forced to commit ritual suicide (Watanabe Kazan, Takano Chōei), or even assassinated as in the case of Sakuma Shōzan.
<gallery widths="200" heights="200">
Image:Phaeton (frigate).jpg|The Royal Navy frigate HMS Phaeton demanded supplies while in Nagasaki harbour in 1808.
Image:MorrisonShip.jpg|The American merchant ship Morrison of Charles W. King was repelled from Edo Bay in 1837.
File:Russians meeting Japanese in Akkeshi 1779.jpg|Russians meeting Japanese in 1779
</gallery>
Perry Expedition (1853–54)
thumb|upright|[[Commodore (USN)|Commodore Matthew C. Perry]]
When Commodore Matthew C. Perry's four-ship squadron appeared in Edo Bay (Tokyo Bay) in July 1853, the shogunate was thrown into turmoil. Commodore Perry was fully prepared for hostilities if his negotiations with the Japanese failed, and threatened to open fire if the Japanese refused to negotiate. He gave them two white flags, telling them to hoist the flags when they wished a bombardment from his fleet to cease and to surrender. To demonstrate his weapons, Perry ordered his ships to attack several buildings around the harbor. The ships of Perry were equipped with new Paixhans shell guns, capable of destroying buildings by delivering explosive shells at high velocity.
Japanese response
In response to the Perry Expedition and increasing incursions of foreign warships into Japanese territorial waters, several modern sailing frigates, including and , were constructed on orders of the Tokugawa shogunate by the Satsuma Domain. The was built from 1853 to 1854 at Sakurajima in what is now Kagoshima Prefecture in accordance with a Dutch blueprint. Furthermore, fortifications were established at Odaiba in Tokyo Bay in order to protect Edo from an American incursion. Industrial developments also commenced soon afterwards in order to build modern cannons. A reverbatory furnace was established by Egawa Hidetatsu in Nirayama to cast cannons.
<gallery widths="200" heights="200">
File:Shohei Maru warship drawing.png|
File:Asahi Maru warship 1856.png|
File:DaiRokuDaiba.jpg|Odaiba battery at the entrance of Tokyo, built in 1853–54 to prevent an American intrusion
File:Japanese coastal wooden cannon 1853 1854.jpg|Coastal wooden cannon built by the at the order of the for Commodore Perry's arrival
Image:Reverberatory furnace of Nirayama.jpg| reverberatory furnace in Izunokuni, Shizuoka built by Egawa Hidetatsu. Construction began in November 1853 and was completed in 1857; it operated until 1864.
