The Battle of Bun'ei, or Bun'ei Campaign, also known as the First Battle of Hakata Bay, was the first attempt by the Yuan dynasty founded by the Mongols to invade Japan. After conquering the Japanese settlements on Tsushima and Iki islands, Kublai Khan's fleet moved on to Japan proper and landed at Hakata Bay, a short distance from Kyūshū's administrative capital of Dazaifu. Despite the superior weapons and tactics of the Mongols, who established the Yuan dynasty in China in 1271, the Yuan forces that disembarked at Hakata Bay were grossly outnumbered by the samurai force; the Japanese had been preparing, mobilizing warriors and reinforcing defenses since they heard of the defeats at Tsushima and Iki. The Japanese defenders were aided by major storms which sunk a sizable portion of the Mongolian fleets. Ultimately, the invasion attempt was decisively repulsed shortly after the initial landings. The Yuan troops withdrew and took refuge on their ships after only one day of fighting. A typhoon that night, said to be divinely conjured wind, threatened their ships, persuading them to return to Korea. Many of the returning ships sank that night due to the storm.
The battle
After landing in the bay, the Yuan force quickly overran the town of Hakata, but were engaged by a number of samurai soon afterwards. At first, the samurai were hopelessly outmatched; accustomed to smaller scale clan rivalries, they could not match the organization and massed firepower of the invaders. The Mongols fought with precision, loosing heavy volleys of arrows into the ranks of the Japanese. The Mongols also employed an early form of rocket artillery, and their infantry used phalanx-like tactics, holding off the samurai with their shields and spears. Though unable to conclusively defeat the Yuan forces, the Japanese fought hard and inflicted heavy casualties. In the course of the day's fighting, the Hakozaki Shrine was burned to the ground. Despite their initial victories, the Yuan did not pursue the samurai further inland to the defenses at Dazaifu. Nihon Ōdai Ichiran explains that the invaders were defeated because they lacked arrows. More likely this was a result of their unfamiliarity with the terrain, the expectation of Japanese reinforcements, and the heavy losses already suffered. The Yuan force, which may have intended to carry out a reconnaissance in force rather than an immediate invasion, returned to their ships. That night, the Yuan lost roughly one-third of their force in a typhoon. They retreated back to Korea, presumably at the prodding of their sailors and captains, rather than regrouping and continuing their attack.
Thousands of Mongolian soldiers were awaiting in Torikai-Gata. Suenaga Takesaki, one of the Japanese commanders, assaulted the Mongolian army and fought them. Soon, reinforcements by Michiyasu Shiraisi arrived there and defeated the Mongolians. The Mongolian casualties of this battle are estimated at around 3,500.
Withdrawal of Mongolian army
Due to the defeat in the battle of Torikai-Gata, the Mongolian army was exhausted. So they withdrew to their own ships. On seeing this situation, the Japanese army did night attacks and killed many soldiers. Finally, Hong Dagu decided to withdraw to Yuan Dynasty. In the midst of the withdrawal, they met a typhoon, most of their ships sank and many soldiers drowned.