Depiction of bearded Emperor Jimmu with his emblematic long bow and an accompanying wild bird.
The first human habitation in the Japanese archipelago has been traced to prehistoric times. The Jōmon 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, the first known written reference to Japan was recorded in the Chinese Book of Han in the first century AD. Between the fourth century and the ninth century, Japan's many kingdoms and tribes gradually came to be unified under a centralized government, nominally controlled by the Emperor. This imperial dynasty continues to reign over Japan. In 794, a new imperial capital was established at Heian-kyō (modern 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 native Shinto practices and Buddhism.
Over the following centuries the power of the Emperor and the imperial court gradually declined and passed to the military clans and their armies of samurai warriors. The Minamoto clan under Minamoto no Yoritomo emerged victorious from the Genpei War of 1180–85. After seizing power, Yoritomo set up his capital in Kamakura and took the title of shōgun. In 1274 and 1281, the Kamakura shogunate withstood two Mongol invasions, but in 1333 it was toppled by a rival claimant to the shogunate, ushering in the Muromachi period. During the Muromachi period regional warlords called daimyōs grew in power at the expense of the shōgun. Eventually, Japan descended into a period of civil war. Over the course of the late sixteenth century, Japan was reunified under the leadership of the daimyō Oda Nobunaga and his successor Toyotomi Hideyoshi. After Hideyoshi's death in 1598, Tokugawa Ieyasu came to power and was appointed shōgun by the Emperor. The Tokugawa shogunate, which governed from Edo (modern Tokyo), presided 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.
Portugal and Japan started their first affiliation in 1543, making the Portuguese the first Europeans to reach Japan by landing in the southern archipelago of Japan. The Netherlands were the first to establish trade relations with Japan, Japan–Netherlands relations dating back to 1609. The American Perry Expedition in 1853–54 more completely ended Japan's seclusion; this contributed to the fall of the shogunate and the return of power to the Emperor in 1868. The new national leadership of the following Meiji period transformed the isolated feudal island country into an empire that closely followed Western models and became a great power. Although democracy developed and modern civilian culture prospered during the Taishō period (1912–26), Japan's powerful military had great autonomy and overruled Japan's civilian leaders in the 1920s and 1930s. The military invaded Manchuria in 1931, and from 1937 the conflict escalated into a prolonged war with China. Japan's attack on Pearl Harbor in December 1941 led to war with the United States and its allies. Japan's forces soon became overextended, but the military held out in spite of Allied air attacks that inflicted severe damage on population centers. Emperor Hirohito announced Japan's unconditional surrender on 15 August 1945, following the atomic bombings of Hiroshima and Nagasaki and the Soviet invasion of Manchuria.
The Allies occupied Japan until 1952, during which a new constitution was enacted in 1947 that transformed Japan into a constitutional monarchy. After 1955, Japan enjoyed very high economic growth, and became a world economic powerhouse. Since the 1990s, economic stagnation has been a major issue. An earthquake and tsunami in 2011 caused massive economic dislocations and a serious nuclear power disaster.