[7][8] The Kamakura shogunate was established by Minamoto no Yoritomo after victory in the Genpei War and appointing himself as shōgun.
Later, the prevailing theory was that the year was 1185, when Yoritomo established the Shugo (守護), which controlled military and police power in various regions, and the Jitō (地頭), which was in charge of tax collection and land administration.
From 1180 to 1185, the Genpei War was fought between the Taira and Minamoto clans as part of a longstanding violent rivalry for influence over the Emperor and his court.
Minamoto no Yoritomo defeated the Taira clan, but in his victory seized power from the civil aristocracy, politically relegating the Emperor and his court to symbolic figureheads.
At the same time, Hōjō Masako maneuvered herself into such a powerful, albeit informal, position that people began calling her the "nun shogun" in the place of her son Yoriie.
[16] Eventually, Tokimasa deposed Yoriie, backed up his younger brother, Minamoto no Sanetomo, as a new shōgun, and assumed the post of shikken.
However, his daughter Hōjō Masako saw this as threat to her own status; she arranged the pretender's murder and banished her father to a monastery.
[16] With Sanetomo's death in 1219, his mother Hōjō Masako continued to serve as the shogunate's real center of power.
[19] The problem was solved by choosing Kujo Yoritsune, a distant relation of the Minamoto, who would be the fourth shōgun and figurehead, while Hōjō Yoshitoki would take care of day-to-day business.
[19] However powerless, future shōguns would always be chosen from either Fujiwara or imperial lineage to keep the bloodline pure[19] and give legitimacy to the rule.
They responded with decisive action for defense—a wall was built to protect the hinterland of Hakata Bay, defensive posts were established, garrison lists were drawn up, regular manning of the home provinces was redirected to the western defenses, and ships were constructed to harass the invaders' fleet when they appeared.
This force embarked and fought the Japanese for some seven weeks at several locations in Kyushu, but the defenders held, and the Mongols made no strategic headway.
Again, a typhoon approached, and the Koreans and Chinese re-embarked the combined Mongol invasion forces in an attempt to deal with the storm in the open sea.
Such losses in men, material, and the exhaustion of the Korean state in provisioning the two invasions put an end to the Mongols' attempts to conquer Japan.
[20] A warlord then went to the exiled emperor's rescue, and in response the Hōjō sent forces again commanded by Takauji to attack Kyoto.
[18] About 870 Hōjō clan, including the last three Regents, committed suicide at their family temple, Tōshō-ji, whose ruins were found in today's Ōmachi.