The recorded military history of Japan began in 2nd century during the Yayoi period.

The Yamato tribal alliance fought amongst the Three Kingdoms of Korea, in the 5th century against Goguryeo and Silla and in 663 against Silla and Tang dynasty forces.

The Nara and Heian periods saw clan warfare and the subjugation of the Emishi people. The Kamakura shōgunate began the Japanese feudal system, led by the shōgun ruler, daimyō lords, and samurai warriors. The 15th to 16th century Sengoku period saw intense civil wars.

The 1603–1868 Tokugawa shōgunate oversaw a relative peace. Its Satsuma Domain invaded and vassalized Ryukyu in 1609. The sakoku policy limited Japan from foreign influences, from 1641 until the 1853 United States Perry Expedition. The 1868–1869 Boshin War led to the Meiji Restoration and colonization of Hokkaido.

The Japanese colonial empire, inspired by Western imperialism, fought the First Sino-Japanese War resulting in the annexation of Taiwan in 1895. The 1904–1905 Russo-Japanese War establish Japan's sphere of influence over Manchuria and Korea, and Korea was annexed in 1910.

Japan invaded Manchuria in 1931, began the full-scale Second Sino-Japanese War in 1937, and invaded French Indochina in 1940. In 1941, Japan began the Pacific War, a major theater of World War II, against the Western Allies, occupying vast areas of southeast Asia including Malaya, the Dutch East Indies, and the Philippines. Japanese war crimes contributed to an Allied civilian death toll of over 26 million. Air raids on Japan killed over a million civilians in Japan. The US atomic bombings of Hiroshima and Nagasaki remain the only uses of nuclear weapons in warfare. Alongside the Soviet invasion of Manchuria, Japan surrendered in August 1945.

The US then occupied Japan until 1952, the only foreign occupation of Japan's history. Article 9 of the 1947 Constitution renounces war and the use of force in international disputes. The 1951 U.S.–Japan Alliance requires the US to defend Japan including extending its nuclear umbrella. In 2015, the Japanese government voted to reinterpret the constitution to allow collective self-defense of Japan's allies.

The Japan Self-Defense Forces, established in 1954, consist of the Japan Ground Self-Defense Force, Japan Maritime Self-Defense Force and Japan Air Self-Defense Force. The Prime Minister serves as commander-in-chief.

Prehistoric and Ancient Japan

Jōmon period (14,000–1000 BC)

The Jōmon period is the time in Japanese prehistory between  14,000 and 1000 BC during which the Japanese archipelago was inhabited by the Jōmon, a hunter-gatherer culture that reached a considerable degree of sedentism and cultural complexity. The name "cord-marked" was first applied by the American scholar Edward S. Morse, who discovered sherds of pottery in 1877 and subsequently translated it into Japanese as jōmon.Mason, 14 The pottery style characteristic of the first phases of Jōmon culture was decorated by impressing cords into the surface of wet clay and is generally accepted to be among the oldest in East Asia and the world.

Near the end of the Jōon period (), villages and towns became surrounded by moats and wooden fences due to increasing violence within or between communities. Battles were fought with weapons like the sword, sling, spear, bow and arrow. Some human remains were found with arrow wounds.

Yayoi period (1000 BC – 300 AD)

The Yayoi period is the Iron Age era of Japan from 1000 BC to 300 AD.Schirokauer et al., 133–143.Silberman et al., 154–155. Japan transitioned to a settled agricultural society. There was a big influx of farmers from the Asian continent to Japan. The Yayoi culture flourished from southern Kyūshū to northern Honshū. The rapid increase of roughly four million people in Japan between the Jōmon and Yayoi periods are partially due to migration and due to a shift from a hunter-gatherer to an agricultural diet with the introduction of rice cultivation.

Bronze goods and bronze-making techniques from the Asian mainland reached the Japanese archipelago as early as the 3rd century BC. It is believed that bronze and, later, iron implements and weapons were introduced to Japan near the end of this time (and well into the early Yamato period). Archaeological findings suggest that bronze and iron weapons were not used for war until later, starting at the beginning of the Yamato period, as the metal weapons found with human remains do not show wear consistent with use as weapons. The transition from the Jōmon to Yayoi, and later to the Yamato period, is likely to have been characterized by violent struggle as the natives were displaced and assimilated by the invaders with their vastly superior military technology.江上波夫 騎馬民族国家 The most well-regarded theory is that present-day Yamato Japanese are descendants of both the Indigenous Jōmon people and the immigrant Yayoi people.

Around this time, San Guo Zhi first referred to the nation of "Wa". According to this work, Wa was "divided into more than 100 tribes", and for some 70 or 80 years there were many disturbances and wars. About 30 communities had been united by a sorceress-queen named Himiko. She sent an emissary named Nashime (, Nashonmi in Chinese) with a tribute of slaves and cloth to Daifang in China, establishing diplomatic relations with Cao Wei (the Chinese kingdom of Wei).

Classical Japan

By the end of the 4th century, the Yamato clan was well established on the Nara plain with considerable control over the surrounding areas. The Five kings of Wa sent envoys to China to recognize their dominion of the Japanese Islands. The Nihon Shoki states that the Yamato were strong enough to have sent an army against the powerful northern Korean state of Goguryeo (of the Three Kingdoms of Korea). Yamato Japan had close relations with the southwestern Korean kingdom of Baekje. In 663, Japan, supporting Baekje, was defeated by the allied forces of Tang China and the southeastern Korean kingdom of Silla, at the Battle of Hakusonko in the Korean peninsula. As a result, the Japanese were banished from the peninsula. To defend the Japanese archipelago, a military base was constructed in Dazaifu, Fukuoka, on Kyushu.

Yamato period (250–710 AD)

This period is divided into the Kofun and Asuka period. Ancient Japan had close ties with the Gaya confederacy and Baekje on the Korean Peninsula. Gaya, where there was an abundance of naturally occurring iron, exported abundant quantities of iron armor and weapons to Wa, and there may have even been a Japanese military post there with Gaya and Baekje cooperation..

In 552, the ruler of Baekje appealed to Yamato for help against its enemies, the neighboring Silla. Along with his emissaries to the Yamato court, the Baekje king sent bronze images of Buddha, some Buddhist scriptures, and a letter praising Buddhism. These gifts triggered a powerful burst of interest in Buddhism.

In 663, near the end of the Korean Three Kingdoms period, the Battle of Baekgang (白村江) took place. The Nihon Shoki records that Yamato sent 32,000 troops and 1,000 ships to support Baekje against the Silla–Tang force. However, these ships were intercepted and defeated by a Silla–Tang fleet. Baekje, without aid and surrounded by Silla and Tang forces on land, collapsed. Silla, now viewing Wa Japan as a hostile rival, prevented Japan from having any further meaningful contact with the Korean Peninsula until a far later time. The Japanese then turned directly to China.

Nara period (710–794 AD)

In many ways, the Nara period was the beginning of Japanese culture as we know it today. It was in this period that Buddhism, the Chinese writing system, and a codified system of laws made their appearance. The country was unified and centralized, with basic features of the later feudal system. Succession disputes were widespread during this period, just as in most of the later periods.

Much of the discipline, weapons, and armor of the samurai came to be during this period, as techniques of mounted archery, swordsmanship, and spear fighting were adopted and developed.

The Nara period saw the appointment of the first Sei-i Tai-shōgun, Ōtomo no Otomaro by the Emperor in 794 CE. The shōgun was the military dictator of Japan with near absolute power over territories via the military. Ōtomo was declared "Sei-i Taishōgun" which means "Barbarian-subduing Great General". Emperor Kanmu granted the second title of Sei-i Tai-shōgun to Sakanoue no Tamuramaro for subduing the Emishi in northern Honshu.Varley, H. Paul. (1980). Jinnō Shōtōki, p. 272.

Heian period (794–1185 AD)

The Heian period marks a crucial shift, away from a state that was united in relative peace against outside threats to one that did not fear invasion and, instead, focused on internal division and clashes between ruling factions of samurai clans, over political power and control of the line of succession to the Chrysanthemum Throne.

With the exception of the Mongol invasions of the 13th century, Japan did not face a considerable outside threat until the arrival of Europeans in the 16th century. Thus, pre-modern Japanese military history is largely defined not by wars with other states, but by internal conflicts. The tactics of the samurai of this period involved archery and swordsmanship. Nearly all duels and battles began with an exchange of arrow fire and then hand-to-hand combat with swords and daggers.

The Imperial family struggled against the control of the Fujiwara clan, which almost exclusively monopolized the post of regent (Sesshō and Kampaku). Feudal conflicts over land, political power, and influence eventually reached its apex in the Genpei War (1180–1185). This was a national civil war between the two most powerful clans: the Taira and Minamoto clans."...the Gempei conflict was a national civil war" Warrior Rule in Japan, page 2. Cambridge University Press. They fought for control over the declining Imperial Court in Kyoto. Each side had a large number of smaller allied clans. The Battle of Dan-no-Ura was a major naval battle between these clans on April 25, 1185. Minamoto had a fleet of 300 ships and Taira had 400 to 500 ships. It resulted in a decisive victory for the Minamoto clan and the destruction of the Taira clan. The end of the Genpei War brought the end of the Heian period and the beginning of the Kamakura period.

Feudal Japan

This period is marked by the departure from relatively small or medium-sized clan-like battles, to massive clashes of clans over the control of Japan. The establishment of the Kamakura shōgunate coincided with the ascendancy of the samurai class over the aristocratic nobility of the Imperial Court. The Shōgunates were military governments and de facto rulers of Japan. They dominated Japanese politics for nearly seven hundred years (1185–1868), subverting the power of the Emperor as a figurehead and the Imperial Court in Kyoto.

In the Kamakura period, Japan successfully repulsed the Mongol invasions, and this saw a large growth in the size of military forces, with samurai as an elite force and as commanders. Following roughly fifty years of bitter fighting over control of the Imperial succession, the Muromachi period, under the Ashikaga shōgunate, saw a brief period of peace as the power of the traditional systems of administration by the Imperial Court gradually declined. Later, the position of the provincial governors and other officials under the shōgunate slowly gave way into a new class of daimyōs (feudal lords) in the early 11th century. The Daimyō were protected by samurai and they dominated Japan's internal politics. This brought the Japanese archipelago into a period of 150 years of fractious disunity and war.

Kamakura period (1185–1333)