In the 13th century, two pivotal events in Japanese history occurred in Hakata (part of modern-day Fukuoka City). In 1274, and again in 1281, Kublai Khan of the Mongolian Empire attempted to invade and subjugate an unprepared and vulnerable Japan. The survival of Japan through these ordeals is an important event in the minds of many Japanese, and the two invasions were the first occasions on which the word kamikaze (神風), meaning “divine wind,” was used. In fact, it was most likely the kamikaze winds that saved Japan from destruction and possible extinction as a civilization.
The massive Mongol Empire had expanded to encompass much of Asia, and after the Korea states submitted to Kublai Khan, the latter sent a series of envoys and threatening letters from 1266 onward demanding that Japan submit as well, which the Japanese rebuffed time and time again. Although the Imperial Court was terrified and suggested surrender, it was the Hojo clan, and not the imperial court, who held true sway over Japan, and they sent the Mongol messengers back empty-handed. Military forces of the han (fiefs) in Kyushu were ordered to move west toward the coast, and defensive preparations were begun.
The combined Korean-Chinese-Mongol invasion fleet came in November 1274, with approximately 23,000 troops and hundreds of ships small and large,; Japan had only managed to muster approximately 10,000 troops to meet them with. The absence of any large-scale battle in recent Japanese history had left no commander experienced in maneuvering large numbers of troops, and the custom of one-on-one combat even in large battles was ill-suited to the type of battles Japan would be fighting with the Mongol forces. Moreover, the Mongols were more experienced and had more advanced weaponry, including primitive grenade-like explosives that could be used in ranged combat. The Mongol forces initially landed on the coast of Hakata Bay and fought land battles with Japanese troops, but during the night a storm arose and Mongol commanders loaded troops back onto ships to avoid becoming stranded on Japanese soil. That night, about 200 Mongol of the ships were destroyed by the storm, and smaller, more maneuverable Japanese boats were used to board the remaining ships, resulting in a Japanese victory.
In preparation for an imminent second invasion, a 20 km (~12.5 mi.) wall and fortifications were built along Hakata Bay. Kublai Khan again sent envoys to Japan and ordered them not to return without a favorable answer; in response, the messengers were brought to the Shogun’s capital of Kamakura and beheaded. Kublai Khan again sent messengers, who were also beheaded in the same manner. Infuriated, a larger Mongol invasion force, this time consisting of approximately 120,000 troops (versus Japan’s now-enlarged 40,000) and thousands of ships crossed over to Japan in 1281. Despite being outnumbered, the new fortifications along the coast made it easier for the Japanese to fight off troops attempting to land. Additionally, a violent typhoon assaulted the region for two days straight, destroy most of the Chinese-made Mongol ships, which were ill-suited for sea travel (let alone sea travel during a typhoon). These winds, which likely saved Japan from a crushing defeat, came to be called kamikaze, and this victory supported the belief that lasted until the end of the Pacific War (World War II) that Japan was protected by the gods and could not be subjugated by a foreign power.
The Mongol invasions exposed Japan to a style of combat they were unfamiliar with, namely large-scale troop-maneuver combat. It also exposed the weaknesses of Japan, and ultimately triggered a power shift that would lead to the dominance of military in the Japanese government–in reality, the dissolution of large-scale government, and emergence civil warfare and violence–for hundreds of years to come.
Some of the walls built to thwart the second invasion attempt can still be seen today in Fukuoka City—I recommend the Iki-no-Matsubara site, which is within walking distance from Shimoyamato Station on the JR Chikuhi Line (some trains on the Kuko Subway Line change act as JR trains from Meinohama Station westward; you can also transfer from subway to JR from trains that terminate at Meinohama). Information on other historical sites and museums related to the Mongol invasions are available at YokoNavi.
Bowdoin College has published thirteenth-century scrolls depicting the Mongol invasions online, and more information on the history of the invasion is available here on Wikipedia.