Ninja or ‘shinobi’ have been referenced in relation to covert operations and assassinations in Japan’s military history. Trained as spies and mercenaries, the ninjas were used and feared by the military nobility – the samurai – from the 15th century A.D.
Ninjas didn’t fight the Mongols for two reasons. The first is that samurais did not use ninjas on the battlefield. The more important reason is that ninjas, as we understand them today, did not appear till the 15th century A.D., while the Mongol invasions took place in the 13th century.
There are some records of the use of espionage in the 13th century. However, these are not attributed to the trained spies and mercenaries that came to be known as ninjas. This article explores who the ninjas and Mongols did fight and who defeated the Mongols when they invaded Japan.
Who Were the Ninjas’ Enemies?
While the samurai were military nobility who had strict codes of chivalry and honor, the ninjas came from the peasant classes who had to learn to fight to survive.
Ninjas worked as mercenaries for hire during wars where their enemies would be the enemies of the daimyo or feudal lords who had hired them. These warlords were also the ninja’s enemies as they didn’t trust the ninjas. The warlord Oda Nobunaga was responsible for wiping out the ninja’s stronghold.
The samurai used the services of the ninjas to perform the work they considered beneath their code of honor, their bushido. The ninjas became indispensable because no one else could do what they did.  However, since they were mercenaries for hire and did not vow loyalty to any one daimyo, they were held in contempt.
Two clans emerged as the ninjas gained more power and money through the wars, especially during the Sengoku period. The Iga and Kōga clans were villages devoted to training new ninjas and were completely independent of any daimyo’s control.
Their way of life and independence irked the daimyo Oda Nobunaga, a powerful warlord. He had begun to unite Japan under his rule in the 16th century, and he began a campaign to capture Iga and bring it under his control.
Nobunaga’s campaign was successful, and the clans in Iga were wiped out, though some families were allowed to flee, and they escaped to the mountains of Kii in the southern provinces.
After Nobunaga united Japan, many ninjas were brought under government control as part of the official military structure and would fight battles alongside regular soldiers. This organization of the ninjas under official structures occurred in the 16th century A.D.
Who Was the Mongols’ Biggest Enemy?
The Mongol Empire covered most of Eurasia in the 13th and 14th centuries, establishing its strongholds in China, Persia, and Eastern Europe. 
The biggest enemies of the Mongols were the Chinese. Genghis Khan set his sights on China for its wealth and size as part of his determination to conquer the world and bring it under Mongol rule. Genghis and his son Kublai Khan conquered all of China, and Kublai Khan named himself emperor.
Genghis Khan was not the first among the Mongol tribes to consider attacking China, but it was under him that all the tribes were united and honed into a singular force. Genghis Khan was named the Great Khan of the Mongols, and soon after, he attacked the states in China.
The Mongols gradually took over the country, starting with the Western Jia in northwestern China and ending with the Song dynasty in the south. After Genghis, his son Kublai Khan decided on taking over the title of emperor of China and completed the process of bringing the Chinese kingdoms under Mongol rule.
Kublai Khan then established the Yuan dynasty, with Beijing as the capital. After establishing the Yuan dynasty, Kublai Khan set his sights on the rest of Southeast Asia. While he achieved mixed results in Vietnam and Burma, he wasn’t as successful in his Japanese campaigns.
Under Kublai Khan, the Mongols invaded Japan twice and failed despite gaining the upper hand due to the severe winds along the coast.
Who Defeated the Mongols?
The Mongols were first defeated by the Turkish Mamluks in Gaza. Later, the Vietnamese defeated Kublai Khan’s forces. The Mongols were also defeated in Japan. However, this defeat was caused by natural winds rather than the Japanese defense.
After Genghis Khan’s death, his sons took over and continued the Mongol Empire. They established dynasties but were limited in how far they could expand.
Hugelu Khan, one of Genghis’s sons, established the Ilkhanate, which was based out of Persia. He marched on to Baghdad, sacked the city, and eventually reached Gaza. 
At Gaza, the army split as Hugelu was called back to the center to deal with succession issues. The reduced army under general Ketquba encountered the Turkish Mamluks, who were as accomplished at warfare and equestrians as the Mongols. The Mamluks defeated the Mongol army at the battle at Ain Jalut, and this was the first significant defeat that the Mongols experienced.
Under Kublai Khan, another one of Genghis Khan’s sons, the Mongols invaded Vietnam, only to find that the Vietnamese had anticipated their attack. The Vietnamese army evacuated the capital, defeated the Mongols, and harassed the Mongol army as they retreated. The Mongols were defeated by the Vietnamese three times, after which they did not return.
The Mongols undertook invasions of the Japanese islands in the 13th century. The first invasion in 1274 began well for the Mongols, who could secure control of the Tsushima and Iki islands.
At Hakata Bay, the samurai attacked the Mongol army’s generals and forced the Mongol soldiers back onto their ships. The next morning, the Mongol ships were blown off by a sudden wind, which destroyed over 200 ships.
In the second invasion in 1281, the Japanese defended Hakata Bay at the Battle of Koan, forcing the Mongols to retreat. A stalemate was reached at Hakata Island when a great typhoon called the kamikaze swept the Mongol fleet and destroyed it.
The ninjas never fought the Mongols as the Mongol army invaded Japan in the 13th century, long before the ninjas appeared in the 15th century.