In 1185, the Minamoto family took over the control over Japan after defeating the Taira clan in the Gempei war. Minamoto Yoritomo established a new military government, the Kamakura Bakufu, in Kamakura and was appointed shogun in the year 1192.
After Yoritomo's death in 1199, quarrels for supremacy started between the Kamakura Bakufu and the Imperial court in Kyoto. Those quarrels for supremacy found an end in the Jokyu disturbance in 1221 when Kamakura defeated the Imperial army in Kyoto, and the Hojo regents in Kamakura achieved complete control over Japan. By redistributing the land gained during the Jokyu disturbance, they were able to achieve loyalty among all the powerful people throughout the country. The emperor and the remaining governmental offices in Kyoto lost practically all effective power.
Chinese influence continued to be relatively strong during the Kamakura period. New Buddhist sects were introduced: the Zen sect (introduced 1191) found large numbers of followers among the samurai, which were now the leading social class. Another new Buddhist sect, the radical and intolerant Lotus Sutra sect was founded in 1253 by Nichiren.
In 1232 a legal code, the Joei Shikimoku was promulgated. It stressed Confucian values such as the importance of loyalty to the master, and generally attempted to suppress a decline of morals and discipline. Tight control was maintained by the Hojo clan, and any signs of rebellions were destroyed immediately.
The shogun stayed in Kamakura without much power while deputies of him were located in Kyoto and Western Japan. Stewards and constables controlled the provinces tightly and loyally. Indeed, the Hojo regents were able to bring several decades of peace and economic expansion to the country until an external power began to threaten Japan.
By 1259, the Mongols had conquered China and became also interested in Japan. Several threatening messages of the powerful Mongols were ignored by Kamakura. This resulted in the first Mongol invasion attempt in 1274 on the island of Kyushu. After only a few hours of fighting, however, the large naval invasion fleet, was forced to pull back because of bad weather conditions. This was very fortunate for the Japanese since their odds against the large and modern Mongol force were not favourable at all.
Due to good preparations, the Japanese were able to maintain a strong defence for several weeks during a second invasion attempt which occurred in 1281. But again, the Mongols were finally forced to withdraw mainly because of bad weather. Kyushu remained in alert for a possible third invasion attempt, but the Mongols soon had too many problems on the mainland in order to care about Japan.
The consequences of the many years of war preparations against the Mongols were fatal to the Kamakura government since they resulted only in expenditures and no profits. Many of the loyal men who were fighting for Kamakura, were now waiting for rewards that the government could not pay. Hence, financial problems and decreasing loyalty among the powerful lords were some of the reasons for the fall of the Kamakura government.
By 1333 the power of the Hojo regents had declined to such a degree that the emperor Go-Daigo was able to restore imperial power and overthrow the Kamakura Bakufu.