The Bakumatsu were the final years of the Tokugawa Shogunate and the isolationist Sakoku policy between 1853 and 1867. The appearance of gunboat diplomacy in Japan in the 1850s, and the forced so-called "opening of Japan" by Western forces, underscored the weakness of the shogunate and led to its collapse. Though the actual end of the shogunate and establishment of an Imperial Western-style government was handled peacefully, through political petitions and other methods, the years surrounding the event were not entirely bloodless. Following the formal termination of the shogunate, the was fought in 1868–1869 between the Tokugawa army and a number of factions of nominally pro-Imperial forces.