Prior to the 9th century in Japan, the Nara and Kyoto courts used the Chinese model of waging war which was the use of an army conscripted from the peasantry. But this proved to not be sufficient to deal with situations that arose, so instead the government began to grant commissions to make war on local landowners and then rewarded them for their trouble. So, instead of controlling the clans, the imperial court's military needs now encouraged them. The clans elite warriors, who rode horses and used bows were the forerunners of the samurai.
The 9th century was a time of upheavals and economic decline due to plagues and episodes of starvation. Influential local rulers exploited this against the court. With riots and lawlessness, there was nowhere for the court to turn but to powerful local lords. The court began granting far-reaching powers to these lords to levy troops of skilled warriors, and to act on their own initiative when disorder threatened. This system grew to favor the strong and the rich.
The 10th century is the time that we first see the term 'samurai', which literally means 'those who serve', being used in purely military context. At first it referred to men who went to the capital to provide guard duty. In time however, it began to denote a military man who served any powerful landlord. The word rapidly acquired a strong aristocratic and hereditary aspect, so the samurai lineages began to be recognized and valued.
The 11th century was a time when particularly strong samurai clans emerged. They were the Taira and the Minamoto, and their exploits dominated Japan for the next 100 years. Samurai from both clans took part on both sides during the Hogen Rebellion of 1156, an armed encounter in Kyoto that was concerned with imperial succession. It was not long before another succession dispute put the Taira and Minamoto in direct opposition. The Taira were victorious in the struggle called the Heiji Rebellion of 1160 and disposed ruthlessly of their rivals.
But in 1180, the survivors of the Minamoto purge, key members of whom had been children spared by the Taira, reopened hostilities at the battle of Uji. This was the first armed conflict in a war that would become known as the Gempei War. The battles of the Gempei War became benchmarks for samurai excellence that were to last for the whole of samurai history. Heroic tales and works of art logged the incidents in the Gempei War as a verbal and visual catalogue of samurai heroism that would show future generations the most noble, brave and correct ways of being a samurai. Nearly all the factors that were to become indelible parts of samurai culture have a reference point somewhere within the Gempei War.
The other way in which the Gempei War made its mark on samurai history lay in the steps the victors took to confirm their triumph. In 1192 Minamoto Yoritomo took the title of shogun. This was the rank that had previously been bestowed temporarily on samurai leaders who had accepted imperial commission to deal with rebels against the throne. But Yoritomo took the title for himself for his new role as military dictator. The difference was that the temporary military commission had now become permanent and was not relinquished until another eight centuries had passed.
Government exercised by the shogun was called the bakufu, a name derived from the maku, the curtains that surrounded a general's headquarters on a battlefield. It was a good name for the new system of ruling that relegated the emperor to the position of figurehead with immense religious power but no political power. The control of Japan's affairs now lay with the leader of the greatest family of samurai.