The samurai, traditionally a warrior class that was at the service of a lord, had increased their political and social influence during the Tokugawa period, by becoming landowners, courtiers, bureaucrats, and administrators rather than warriors. However
As a consequence of the rigid structure that composed the social system, Japan was a backward country when compared to the overwhelming power of the European and American empires of the time. Like other subjugated Asian nations, the Japanese were forced to sign unequal treaties with Western powers, which granted them one-sided economical and legal advantages in Japan. The very inflexibility of the caste system, lacking all forms of economic dynamism and neglecting inflation effects, unleashed huge economic crisis and general empoverishment.
The Meiji Restoration
En 1867, an alliance of several of the most powerful daimyo (Satsuma and Kido) with the titular Emperor finally succeeded in the overthrow of the Tokugawa shogunate after the Boshin War, culminating in the Meiji Restoration. The power of the Emperor became increasingly stronger, and after a series of confrontations against his former allies, he gained all the lands under his own control.
The Emperor was convinced that Japan needed to become a World power by following the model of the Western empires. This way, the four-caste division of the society was abolished and freedom of social and occupational mobility was guaranteed. The education became compulsory, and the education system reformed after the French and German ones. Freedom of worship was also established, a constitution was edited and several forms of democratic participation of the citizens founded. Agrarian reforms and massive industrial development were succesfully undertaken, the concept of a market economy and the adoption of British and North American forms of free enterprise capitalism were welcomed by a country that soon showed its abundance of aggressive entrepreneurs. As a consequence, Japan emerged as the first Asian industrialised nation and one of the new great World powers.
What happened to the samurai?
All this logically meant the end for the samurai. As they received fixed revenues from the government, their upkeep was a tremendous financial limit for a nation in development (there were 1.9 million samurais at the time), so the Meiji government started a slow process to progressively abolish this social class. Most of their salaries were diminished or cancelled, and the ones that remained had to convert them into government bonds (which, of course, had no guarantee of being valid if the central government failed). A Western-like nobility classification was established among the remaining samurai and courtiers: prince, marquis, count, viscount, and baron were new conceded entitlements.
The reform of the military was the real end of the samurai privileges. In 1873, nation-wide conscription was established, and the right to bear arms was extended to every male in the nation. In this manner,
Although many samurai became wandering warriors and some riots arose (such as the major Satsuma rebellion, lead by the samurai Saigo Takamori), most samurai adapted easily to their new condition. Many found employment as policemen or in the government bureaucracy, which resembled an elite class in its own right. The samurai, being better educated than most of the population, became teachers, government officials or military officers. However, the ideal of samurai military spirit lived on in romanticised form and was often used as nationalistic propaganda during the 20th century.