Japan’s feudal era was characterized by the emergence and dominance of a ruling class of warriors, the samurai. In 1185, following the defeat of the Taira clan, sung in the epic Tale of Heike, samurai Minamoto no Yoritomo was appointed shogun and established a base of power in Kamakura. After his death, the Hojo clan came to power as regents for the shoguns. The Zen school of Buddhism was introduced from China in the Kamakura period (1185–1333) and became popular among the samurai class. The Kamakura shogunate repelled Mongol invasions in 1274 and 1281, but was eventually overthrown by Emperor Go-Daigo. Go-Daigo was himself defeated by Ashikaga Takauji in 1336.
Ashikaga Takauji establishes the shogunate in Muromachi, Kyoto. It is a start of Muromachi Period (1336–1573). The Ashikaga shogunate receives glory in the age of Ashikaga Yoshimitsu, and the culture based on Zen Buddhism (art of Miyabi) has prospered. It evolves to Higashiyama Culture, and has prospered until the 16th century. On the other hand, the succeeding Ashikaga shogunate failed to control the feudal warlords (daimyo), and a civil war (the Onin War) began in 1467, opening the century-long Sengoku period (“Warring States”).
During the 16th century, traders and Jesuit missionaries from Portugal reached Japan for the first time, initiating direct commercial and cultural exchange between Japan and the West. Oda Nobunaga conquered many other daimyo using European technology and firearms; after he was assassinated in 1582, his successor Toyotomi Hideyoshi unified the nation in 1590. Hideyoshi invaded Korea twice, but following defeats by Korean and Ming Chinese forces and Hideyoshi’s death, Japanese troops were withdrawn in 1598. This age is called Azuchi–Momoyama period (1573–1603).
Tokugawa Ieyasu served as regent for Hideyoshi’s son and used his position to gain political and military support. When open war broke out, he defeated rival clans in the Battle of Sekigahara in 1600. Ieyasu was appointed shogun in 1603 and established the Tokugawa shogunate at Edo (modern Tokyo). The Tokugawa shogunate enacted measures including buke shohatto, as a code of conduct to control the autonomous daimyo; and in 1639, the isolationist sakoku (“closed country”) policy that spanned the two and a half centuries of tenuous political unity known as the Edo period (1603–1868). The study of Western sciences, known as rangaku, continued through contact with the Dutch enclave at Dejima in Nagasaki. The Edo period also gave rise to kokugaku (“national studies”), the study of Japan by the Japanese.