Since bushido means 'the way of the samurai,' the term 'samurai' first needs to be clarified. If samurai is defined as warriors employed for the defense of the community, like those in prehistory who served the Yamato clan in its territorial expansions, or those of the early historical period who served as guards to the aristocracy, then the samurai, like warriors in any other society, have their origin in very early times. But in prehistorical and earliest historical times, Japanese warriors existed under a political system governed by the aristocracy. So while they served the aristocracy, they did not develop a distinct sense of identity. Only when they emerged as the guardians of manorial properties in the provinces, when distinct ties of allegiance developed between the head of the manor and his retainers, and when their position became hereditary, did their social status become distinct. Their emergence as a socially identifiable group dates from the late Heian period (the mid-twelfth century) during the time of the great military clans of the Genji and Heike. From that time until the beginning ofJapan's emergence as a modern state (1868), the samurai ruled Japan for some 800 years. Over this period their world view and their code of conduct naturally underwent change.