Before the establishment of the Kamakura shogunate, civil power in Japan was primarily held by the ruling emperors and their regents. The regents were typically appointed from the ranks of the imperial court and the aristocratic clans that vied there. Military affairs were handled under the auspices of the civil government. After defeating their main rival the Taira clan, the Minamoto clan established the Kamakura shogunate. Minamoto no Yoritomo seized power from the central government and the aristocracy and established a feudal system based in Kamakura. The samurai gained political power over the aristocratic nobility ("kuge") of the Imperial Court in Kyoto. Emperor Go-Toba and the aristocracy remained the "de jure" rulers. In 1192, Yoritomo was awarded the title of "Sei-i Taishōgun" by Emperor Go-Toba. The political system that Yoritomo developed with a succession of "shōguns" as the head became known as a shogunate. This brought a period of peace. The battles fought during this period mainly consisted of agents of the Minamoto suppressing rebellions. Yoritomo's wife's family, the Hōjō, seized power from the Kamakura "shōguns". When Yoritomo's sons and heirs were assassinated, the "shōgun" himself became a hereditary figurehead. Real power rested with the Hōjō regents. The Kamakura shogunate lasted for almost 150 years, from 1192 to 1333. The Mongol invasions of Japan (1274 and 1281) were the most important wars of the Kamakura period and defining events in Japanese history.