were the hereditary military nobility and officer caste of medieval and early-modern Japan from the late 12th century until their abolition in the 1870s during Meiji era. They were the well-paid retainers of the daimyo, the great feudal landholders. They had high prestige and special privileges such as wearing two swords and kiri-sute gomen, the right to kill anyone of a lower class in certain situations. They cultivated the bushido codes of martial virtues, indifference to pain, and unflinching loyalty, engaging in many local battles. Though they had predecessors in earlier military and administrative officers, the samurai truly emerged during the Kamakura shogunate, ruling from 1185 to 1333. They became the ruling political class, with significant power but also significant responsibility. During the 13th century, the samurai proved themselves as adept warriors against the invading Mongols. During the peaceful Edo period, 1603 to 1868, they became the stewards and chamberlains of the daimyo estates, gaining managerial experience and education. In the 1870s, samurai families comprised 5% of the population. As modern militaries emerged in the 19th century, the samurai were rendered increasingly obsolete and very expensive to maintain compared to the average conscript soldier. The Meiji Restoration ended their feudal roles, and they moved into professional and entrepreneurial roles. Their memory and weaponry remain prominent in Japanese popular culture. Terminology In Japanese, historical warriors are usually referred to as , meaning 'warrior', or , meaning 'military family'. According to translator William Scott Wilson: "In Chinese, the character 侍 was originally a verb meaning 'to wait upon', 'accompany persons' in the upper ranks of society, and this is also true of the original term in Japanese, saburau. In both countries the terms were nominalized to mean 'those who serve in close attendance to the nobility', the Japanese term saburai being the nominal form of the verb." According to Wilson, an early reference to the word saburai appears in the Kokin Wakashū, the first imperial anthology of poems, completed in the early 900s. In modern usage, bushi is often used as a synonym for samurai; however, historical sources make it clear that bushi and samurai were distinct concepts, with the former referring to soldiers or warriors and the latter referring instead to a kind of hereditary nobility. The word samurai is now closely associated with the middle and upper echelons of the warrior class. These warriors were usually associated with a clan