The Shinsengumi (新選組 or 新撰組?, meaning "the new squad") was a special police force organized by the Bakufu (military government) during Japan's Bakumatsu period (late shogun) in 1864. It was active until 1869. It was founded to protect the Shogunate representatives in Kyoto at a time when a controversial imperial edict to exclude foreign trade from Japan had been made and the Chōshū clan had been forced from the imperial court. The men were drawn from the sword schools of Edo. Although the Shinsengumi are lauded as brave and determined heroes in popular culture, they have been described by historians as a "ruthless murdering death squad".
Japan's forced opening to the west in 1854, which required it to open its shores for trade or face military conflict, exacerbated internal political instability. One long-standing line of political opinion was sonnō jōi (meaning, "revere the emperor, expel the barbarians"). Loyalists (particularly the Chōshū clan) in Kyoto began to rebel. In response, the Tokugawa shogunate formed the Rōshigumi (浪士組?, meaning "the rōnin squad") on October 19, 1863. The Rōshigumi was a squad of 234 rōnin (Samurai without master) drawn from the sword schools of Edo.