Battle of Mayi

The Battle of Mayi (Chinese: 馬邑之戰), also known as the Scheme of Mayi (馬邑之謀) or the Encirclement at Mayi (馬邑之圍), was an abortive ambush operation by the Han dynasty against the invading Xiongnu forces led by Junchen Chanyu, with minimal casualties from both sides. Although no fighting actually took place, it marked the end of de jure peace between the Han dynasty and Xiongnu, and led to the beginning of the subsequent Han-Xiongnu War. The failure of the operation also motivated the Han court to develop effective cavalry forces and the use of offensive expeditionary military policies.

Battle of Mayi
Part of the Han–Xiongnu War
DateJune, 133 BC
Result Aborted by Xiongnu retreat
Xiongnu Han dynasty
Commanders and leaders
Junchen Chanyu Emperor Wu of Han
Wang Hui
Han Anguo
Li Xi
Li Guang
Gongsun He
100,000 cavalry 270,000 Han infantry at Mayi, 30,000 Han infantry at Dai Prefecture
Casualties and losses
None None, other than the capture of a low-profile outpost sentry


Before the Battle of Mayi, there had been two main encounters between the Chinese and the Xiongnu. During the Warring States period, General Li Mu of the State of Zhao defeated the Xiongnu by luring them deep inside Zhao territory and ambushing them. With similar tactics, General Meng Tian of the Qin dynasty drove the Xiongnu north for 750 km and built the Great Wall at the edge of the Loess Plateau to guard against future raids. However the collapse of the Qin dynasty and the subsequent chaos of the Chu-Han contention created a power vacuum and allowed the Xiongnu to unite under Modu Shanyu and became a powerful nomadic confederacy.

After Emperor Gao's humiliating defeat at Baideng by Modu in 200 BC, the newly established Han dynasty was forced to resort to an appeasement policy in order to decrease the scale of Xiongnu hostility, as the nation had yet to fully recover from the attrition of the Chu-Han contention. However, despite the periodic gifts and heqin ("peace through marriage"), border townships and villages were still seasonally ravaged by nomads, as the prosperous Chinese lands remained attractive to Xiongnu raids.

After seven decades, the Han dynasty had built up its military strength. Emperor Wu initially maintained a policy of peace and appeasement in his early reign, but began to formulate ideas of striking a major blow back against the Xiongnu. The traditional Chinese strategy was more conservative and defensive, aiming to lure the Xiongnu cavalry into Chinese territory, on terrains where the Chinese army, composed almost entirely of infantry and charioteers, would be at a counteroffensive advantage.


In 133 BC, at the suggestion of Wang Hui, the minister of vassal affairs, Emperor Wu had his army set a trap for the Xiongnu Shanyu at the city of Mayi. A powerful local trader/smuggler, Nie Wengyi, also known as Nie Yi, deceptively claimed to Junchen Shanyu that he had killed the local magistrate and was willing to offer the city to the Xiongnu. The plan was to entice the Shanyu's forces into advancing on Mayi, so that a 300,000-strong Han force hidden around the area could encircle and ambush them.

The plan failed, ironically, because the Han arrangement was made excessively attractive. When the Shanyu took the bait and moved in for a raid on Mayi, he saw fields full of cattle but with no herders. Feeling increasingly suspicious, the Shanyu ordered his men to halt their advance. Xiongnu scouts then captured a Han soldier from a local outpost, who disclosed the entire plan to the Shanyu. Shaken with shock, the Shanyu then abandoned the raid and withdrew quickly before the Han forces could act. The Han forces were scattered at this point, and unable to concentrate in time to catch the Xiongnu. Wang Hui, the commander of the entire Han operation, had only 30,000 troops under his direct command, too few to stop the Xiongnu from retreating to the steppe, so he hesitated and ordered the Han forces not to pursue. As a result, neither side suffered any casualties.


Back at the imperial court, Wang Hui's political enemies blamed him for the plan's failure and his reluctance to pursue the retreating Xiongnu army, and had him impeached. While awaiting trial, he sent men to bribe the chancellor Tian Fen, who is Emperor Wu's maternal uncle, in the hope of obtaining a parole. When Emperor Wu still refused to spare Wang (possibly because the emperor was wary of Tian Fen's growing power), he committed suicide in prison.

Though border military clashes had already continued for decades between the two sides, this "battle" ended the de jure "peace" between the Han and Xiongnu. The ambush operation revealed the Han dynasty's hawkish stance, and the "marriage/gift for peace" policy was officially abandoned. For the next few years, Xiongnu would increase their border attacks, further solidifying the cause of pro-war factions and their control in the Han court.

The result of the battle made Emperor Wu realize the difficulty for the traditionally chariot/infantry-orientated Han army to achieve tactical superiority against the more mobile Xiongnu cavalry. This led to a change in Han strategy and hastened the development of an effective cavalry doctrine. In later campaigns, the Han dynasty went from a defensive-counteroffensive stance to an offensive strategy of launching expeditionary warfare deep into Xiongnu territory.

The failure of the Mayi operation also prompted Emperor Wu to reconsider his choice of commanders. Disappointed at the ineffectiveness of existing generals, Emperor Wu began to look for younger generations of military hopefuls capable of offensive anti-cavalry warfare. That led to the rise of famous new-generation tacticians like Wei Qing and Huo Qubing, and old-school commanders like Li Guang and Han Anguo began to fall out of favor.


  • Ban Gu et al., Hanshu. Beijing: Zhonghua Shuju, 1962. ISBN 7-101-00305-2
  • Sima Guang, comp. Zizhi Tongjian. Beijing: Zhonghua Shuju, 1956. ISBN 7-101-00183-1