From the 3rd century, rulers were buried in huge earth tombs, or kofun, many shaped like a keyhole when seen from above, surrounded by moats and lined with clay figures called haniwa. The largest, the Daisen Kofun near Osaka, is roughly half a kilometre long.

The tombs show power gathering in the Yamato region, around modern Nara and Osaka. The Yamato rulers are the ancestors of today’s imperial family.

Buddhism arrived officially from the Korean kingdom of Baekje in the 6th century; the sources give either 538 or 552. Court clans fought over the new religion, and the pro-Buddhist Soga clan defeated its rivals, the Mononobe, in 587 and dominated the court.

Prince Shōtoku (Buddhist prince-regent), regent for Empress Suiko (first reigning empress), is credited with promoting Buddhism, issuing a “Seventeen-Article Constitution” of moral rules for officials (traditionally dated 604), and sending embassies to China. In 645 a palace coup destroyed the Soga and launched the Taika Reforms, which copied China’s centralised system: state ownership of land, registers of households, taxes and written law. The Taihō Code of 701 completed the framework.