Nara, Heian, and Kamakura Japan. Medieval Japan's story is told in three ages, each named for its seat of power: the Nara period (710-794), when Japan built itself on the Chinese model; the Heian period (794-1185), when it turned inward to create a culture all its own; and the Kamakura period (1185-1333), when the samurai seized the state. Together they transformed Japan from a student of China into a civilization with its own unmistakable voice.
The Nara period opened in 710 when Empress Genmei established Japan's first permanent capital at Heijo-kyo (modern Nara), a city laid out on the grid of the Tang capital Chang'an. Everything Chinese was the model: Chinese writing, Chinese law codes, Chinese schools of Buddhism. The court commissioned Japan's first histories, the Kojiki and Nihon Shoki, to glorify the imperial line, and its poets compiled the Man'yoshu, the great early anthology of Japanese verse.
In 794 Emperor Kanmu moved the capital to Heian-kyo - Kyoto, which would remain the imperial capital for a thousand years - and the long Heian age began. Real power passed to the Fujiwara clan, who married their daughters to emperors and ruled as regents, while at court a refined aristocratic culture flowered: the new hiragana and katakana scripts freed Japanese from Chinese, and court women wrote the masterpieces of the age - Sei Shonagon's Pillow Book and Murasaki Shikibu's Tale of Genji. Buddhism took Japanese forms in the Tendai and Shingon sects of Saicho and Kukai. But beyond the capital, great estates slipped from imperial control, and the warrior class - the samurai - grew strong. In 1156 the warrior Taira no Kiyomori seized power; in the Genpei War that followed, the Taira were annihilated at the naval battle of Dan-no-ura in 1185.
The victor, Minamoto no Yoritomo, did not abolish the throne - he simply ruled beside it. Taking the title of shogun in 1192, he governed Japan from Kamakura while the emperor reigned as figurehead in Kyoto: the shogunate, Japan's warrior government, had begun, and it would last nearly seven centuries. The Hojo clan soon ruled as regents for puppet shoguns; under them Japan survived the Jokyu War of 1221 and, above all, Kublai Khan's two Mongol invasions in 1274 and 1281 - both shattered by the typhoons Japan remembered as the kamikaze, the 'divine wind.' The age saw Zen, Pure Land, and Nichiren Buddhism take root among warriors and commoners. In 1333 Emperor Go-Daigo briefly overthrew the shogunate in the Kenmu Restoration, but the samurai order was irreversible: the Ashikaga shoguns followed in 1336, and warrior rule defined Japan until the 19th century.