It is widely accepted that first humans in the Japanese archipelago can be traced back to prehistoric times. The Jomon period, named after its “cord-marked” pottery, was followed by the Yayoi in the first millennium BC when new technologies were introduced from continental Asia. During this period, in the first century AD, the first known written reference to Japan was recorded in the Chinese Book of Han.
Between the fourth century and the ninth century, Japan’s many kingdoms and tribes slowly came together under a centralized government, mostly controlled by the Emperor. The imperial dynasty established at this time continues to reign over Japan to this day. In 794, a new imperial capital was established at Heian-kyo (modernly known as Kyoto), marking the beginning of the Heian period, which lasted until 1185. The Heian period is considered a golden age of classical Japanese culture. Japanese religious life from this time and onwards was a mix of Buddhism and native religious practices known as Shinto (Wikipedia). The religions remain similar to that setup today.
During the following centuries, the power of the Emperor and the imperial court slowly decreased and eventually moved on to the military clans and their armies of samurai warriors. The Minamoto clan under Minamoto no Yoritomo was victorious during the Genpei War of 1180–85. After seizing power, Yoritomo set up his capital in Kamakura and changed his title to shogun. In 1274 and 1281, the Kamakura shogunate withstood two Mongol invasions, but in 1333 it was defeated by a rival, ushering in the Muromachi period. During the Muromachi period, regional warlords called daimyo grew in power at the expense of the shogun. Eventually, Japan fell into a period of civil war. Over the course of the late sixteenth century, Japan ended the civil war and found peace under the leadership of the daimyo Oda Nobunaga and his successor Toyotomi Hideyoshi.
After Hideyoshi’s death in 1598, Tokugawa Ieyasu came to power and was appointed Shogun by the Emperor. The Tokugawa shogunate, which governed from Edo (modern Tokyo), occurred over a prosperous and peaceful era known as the Edo period (1600–1868). The Tokugawa shogunate imposed a strict class system on Japanese society and cut off almost all contact with the outside world (Wikipedia). Japan was separated from the rest of the world for a very long time, leaving it with some catching up to do when it came back into the world.