Samurai on horseback

Samurai can be likened to the knights of medieval Europe in that they fought for their lord and maintained a strict code of chivalry and brotherhood.

In Japan the lords were also known as chiefs and represented family related clans. The chiefs controlled different parts of Japan with the assistance of their samurai fighters. The wealthier the clan, the more Samurai they had to protect and sometimes increase their boundaries and tax revenues.

Japan was virtually isolated from the period of enlightenment, trade, colonisation and industrialisation that Europe experienced after the close of the Dark Ages. While the last Tokugawa shogunate attempted to learn from the foreigners to some degree, they lacked a strong central administration capable of instituting the reforms required to modernise. Feudalism continued and the Samurai became a strong class in their right.

A Brief History of Samurai by Mark McGee provides an historical overview of and describes the shift on battle methods and dress as the Samurai evolved.

Increasing foreign delegations to Japan seeking trade, culminated in the two visits by US commander Perry in 1853 and 1854. In the first visit, Perry issued demands from the US president regarding access for trade. In the return visit to obtain the shogunate government’s response, Perry led an intimidating fleet of warships and the Japanese agreed to open up to more trade. Many Japanese elite of young nobles and ruling samurai leaders, realised Japan needed a strong central government to modernise at a faster rate.

Satsuma samurai during the Boshin WarThis eventually led to the Boshin War in 1867-68 where an alliance of western samurai forces, being the strong Satsuma contingent led by Saigo Takamori as well as forces from Chosu, sided with the royal family to restore the power of a centralised Imperial Court.

The ruling Shogun, Tokugawa Yoshinobu abdicated, expecting to retain a high level of power and privileges in the new court. The young Meiji emperor, acting on advice from the samurai leaders siding with the royal family, disbanded the house of Tokugawa leading to the civil war, which lasted 18 months.

Though smaller in numbers, the new Imperial Army and the Meiji loyal samurai forces were better equipped and in a series of battles finally defeated the larger combined Samurai armies, led by the Tokugawa clan. Lingering resistance in the north was brought to a head in April 1869 when the Imperial forces defeated the resisting Samurai at the Battle of Hakodate.

Without committing troops, the French and British were both involved in the Boshin War. The French had long supported the last Shogun with advice and weaponry, while the Satsuma clan had modernised their Samurai with British weapons and training. Wikipedia has a good review of the Boshin War.

Saigo Takamori with officersInterestingly, Saigo Takamori, who was vital in the Meiji restoration soon became disillusioned with the direction of the Meiji regime and led the Satsuma rebellion in 1877 

So the Samurai went through a protracted period of upheaval from late 1868, when some of them supported the new regime until their demise in 1877, when the last Samurai were crushed and Takamori himself was killed in the final battle.

Fabulous Wikipedia provides a comprehensive history of the Samurai as well on the 1877 Satsuma Rebellion and the earlier 1874 Saga Rebellion