Samurai (侍) or bushi (武士, [bɯ.ɕi]) were members of the warrior class who served as retainers to lords (including daimyo) in Japan. They were originally provincial warriors who served the Kuge and imperial court in the late 12th century, and eventually came to play a major political role until their abolition in the late 1870s during the Meiji era. Although they had predecessors in earlier military and administrative officers, the bushi truly emerged during the Kamakura shogunate, ruling from c.1185 to 1333.
https://en.wikipedia.org/wiki/Samurai