In ancient, feudal Japan, the members of the army permanently in the service of the shōguns (a sort of generalissimo) or the daimyō (feudal lords) all belonged to the same warrior caste called buke, and they were known as bushi. But in the rest of the world, they were known by a Chinese name that we could translate as “vassals”, that is, samurai. According to some, this name was once reserved for the clan chieftains of northern Japan, or for the soldiers of the imperial court during the Muromachi period (1392–1590), the goshozamurai. This was then extended to the warriors authorized to bear together with the armor both the long sword (katana) and the short one (wakizashi), who was placed in the service of a lord.
So, "samurai" can be more accurately translated as “he who serves”. But in the early middle ages when Japan was divided between clans (ruled over by the imperial family), the term “samurai” had yet to be coined. There were warriors, but not their class. Only later would the guardians of the imperial palace be called samurai, that is “servants” (of the aristocracy).
This took place when the Minamoto clan took power and created a diarchy: the emperor was the sovereign and the shōgun was his primary vassal; over time, however, the emperor was increasingly overshadowed by the shōgun.
The first shōgun was Yoritomo Minamoto (1192), who imposed military rule (bakufu) and relegated the emperor to a limited role as Shinto priest. While, at this time, anyone could become a samurai, the only descendants of the Minamoto clan could aspire to the title of shōgun.
Toyotomi Hideyoshi (1536-1598), who reunited Japan after a bloody war, was the son of peasants and had to settle for the modest title of taiko. He was the one who imposed the law restricting the right to bear arms to the samurai alone. After the Battle of Sekigahara (1600), the shogunate became hereditary within Tokagawa clan.
The lengthy wars of the Japanese Middle Ages had attributed increasing importance to the military profession, created a form of natural selection. The upshot was that the samurai became a privileged class. Taking inspiration from philosophical and religious elements, a code of ideals, standards, and principles took form, though it was never set in writing. Called the bushido (“the way of the warrior”), it was based on righteousness, disregard for danger, honor, indifference to physical and moral suffering, limitless loyalty to one’s lord.
With the abolition of the feudal system in 1869, the samurai were incorporated with the name shizoku into modern Japanese aristocracy.