Battle of Shayuan
The Battle of Shayuan () was fought in 537 AD and was the second battle between the two successor states of Northern Wei during the Southern and Northern Dynasty period. During the battle, Yuwen Tai of Western Wei successfully ambushed and miraculously defeated the more than twenty times larger Eastern Wei army of Gao Huan that was marching towards Chang'an. The battle firmly established Western Wei's control of the Guanzhong Plain. Background 
By the start of the 6th century AD, the Northern Wei dynasty had been in control of north China for over 100 years, however a series of events at the beginning of the century would bring about its collapse. The Six Frontier Towns rebellion began in 523, with the garrisons of the major forts guarding the dynasty’s northern border turning against their commanders and the government, beginning a rebellion that would send the region into chaos. It also inspired numerous other rebellions throughout the empire, each with their own grievances against the Northern Wei. This situation was not helped by the fact that the Northern Wei court was almost always in crisis. In 528 the 18 year old Emperor Xiaoming was killed by his own mother, Empress Dowager Hu, who was in turn killed by the general Erzhu Rong. Erzhu Rong successfully put down many of the rebellions against the Northern Wei, but he was killed by the new Emperor Xiaozhuang in 530, who was then captured and killed by Erzhu Shilong and Erzhu Zhao. It was during this time that Gao Huan rose to prominence. Gao Huan was from a poor family and had been serving numerous rebel warlords before meeting Erzhu Rong. He soon impressed Erzhu and was made one of his commanders, participating in his takeover of the imperial government and campaigns against various rebels. Following Erzhu Rong’s assassination he initially supported Erzhu Shilong and Erzhu Zhao against Emperor Xiaozhuang, but shortly after the emperor’s death he became convinced that he could defeat the Erzhu clan and so rebelled against them. Thus another civil war broke out and by 532 Gao Huan had defeated and killed the Erzhus and took control of the imperial government. The new Emperor Xiaowu attempted to resist Gao Huan’s influence by aligning himself with another general called Heba Yue, who controlled many of the western provinces. Gao Huan managed to persuade another warlord called Houmouchen Yue to betray Heba Yue, and Houmouchen had Heba assassinated, however he failed to take over Heba Yue’s army which was then brought under control by Heba’s second in command Yuwen Tai. Yuwen Tai was a descendant of the Xianbei Yuwen tribe and had been serving under many warlords during the recent series of civil wars, but had only risen to prominence under Heba Yue. Yuwen attacked and defeated Houmouchen Yue, who committed suicide. In 534 Gao Huan became aware that Emperor Xiaowu was building troops to fight him and so marched towards the capital Luoyang, forcing Emperor Xiaowu to flee to the territory of Yuwen Tai. Gao Huan tried to convince Xiaowu to return to Luoyang but when this failed he made Yuan Shanjian emperor (as emperor Xiaojing). There were now two emperors, thus splitting the Northern Wei dynasty into Eastern Wei and Western Wei. However this wouldn’t have seemed permanent to many at the time, as Gao Huan’s Eastern Wei was larger and militarily stronger and Western Wei did not look likely to survive. Yuwen Tai nevertheless prepared to resist Gao Huan

Prelude 
In early 537 Gao Huan advanced into the Western Wei heartland of the Guanzhong Plain, splitting his forces into 3 parts, one part commanded by himself, and the other parts commanded by his generals Gao Aocao and Dou Tai. Yuwen Tai’s army was significantly smaller but he managed to engage Dou Tai’s force on its own at the Battle of Xiaoguan, crushing it and killing Dou Tai. The other parts of Gao Huan’s army subsequently retreated. However this was not the end of Western Wei’s troubles, for the state was also suffering from a severe famine. Because of this Yuwen Tai launched a counterattack against the Eastern Wei, seizing the Hongnong Commandery which he began stripping of food to be sent back to Western Wei territory. Upon hearing this Gao Huan immediately began raising more forces and was quickly marching to Hongnong. Gao Huan reportedly had a massive army of up to 200,000 men, though some consider this as too high. Even if he didn’t have 200,000 soldiers, Gao Huan’s army was certainly significantly larger than Yuwen Tai’s, who reportedly only had 10,000 men at his disposal. Upon hearing of the approach of Gao Huan’s army, Yuwen Tai withdrew his forces from Hongnong. Gao Huan planned to march into Western Wei territory and engage Yuwen Tai with his numerically superior force, however it is said that many of his advisors opposed this. One councillor known as Xue Tang said that Gao Huan didn’t need to attack at all, as long as he prevented Yuwen Tai from getting any more food then the Western Wei army, and subsequently state, would break down from starvation. Gao Huan was eager to personally avenge Dou Tai however and so rejected this advice. The general Hulü Qiangju suggested that Gao Huan’s forces were so much bigger than his opponents that he could split his forces, with one force only needing stall Yuwen Tai while the other captured the Western Wei capital, Chang’an, which could deal a heavy blow to Western Wei at minimal loss for Gao Huan. However splitting his forces was what caused the previous defeat at Xiaoguan so Gao Huan rejected this advice too. With the benefit of hindsight, many modern authors think that these plans were both sound and had Gao Huan adopted them then he would have destroyed the Western Wei 

Yuwen Tai meanwhile was searching for a battlefield that would give him a chance of victory against Gao Huan and when he arrived near Shayuan his general Li Bi found a perfect site at the Weiqu marshland, ten miles away. The area was covered in reeds which were perfect for ambush and was located within a bend in the Wei River so Gao Huan’s large army would be funnelled inward. Yuwen Tai agreed and so set his men up in the marshland. Some were located in a clearing in the reeds to draw in the Eastern Wei army while a large cavalry contingent under Li Bi lay in ambush. Battle 
Gao Huan arrived soon after, intent on crushing Yuwen Tai. When he saw the small Western Wei force and the reeds he realised the potential for ambush and considered setting fire to the reeds to draw out any soldiers within them, however his generals Hou Jing and Peng Le opposed this, Hou because he thought that Western Wei would not surrender if Yuwen Tai's body was burnt and Peng because he believed the Eastern Wei advantage to be so large that no such plan was necessary, and so Gao Huan eventually decided against the idea. His troops all advanced in one towards the Western Wei army, however as they were beginning to engage the smaller force consisting of Li Bi’s cavalry sprang out from the reeds, cutting through the Eastern Wei army and splitting it in half. Yuwen Tai then commanded the camouflaged troops and launched a frontal assault against the Eastern Wei Army. Even though the Eastern Wei still had significantly more soldiers, a large part of the army was now being surrounded and thus began to rout, this panic spread to the rest of the army and despite Gao Huan and his generals best efforts to regain control of them the whole army was soon in retreat. The battle was short and the vast majority of Eastern Wei casualties came during the retreat rather than the engagement itself. 6,000 Eastern Wei soldiers were killed and 70,000 captured at the expense of minimal Western Wei casualties. Aftermath 
The battle greatly changed the balance of power between the Western and Eastern Wei, with the Eastern Wei’s military strength being reduced significantly enough that they were no longer able to threaten the Western Wei heartland of the Guanzhong plain. Instead it became the Western Wei’s turn to threaten Eastern Wei territory and the Western general Dugu Xin briefly occupied the former Northern Wei capital Luoyang in 538. Even by the time the Eastern Wei had recovered from the defeat at Shayuan the Western Wei were in a much better position, having consolidated its control over the north-west of China and were no longer in famine and so were able to fight the Eastern Wei on equal footing. The Battle of Shayuan is considered by many to be a very important battle in Chinese history as in 557 the Western Wei was succeeded by the Northern Zhou who were themselves succeeded by the Sui Dynasty in 581, who went on to unify China. Had the Western Wei fallen at Shayuan then the Sui dynasty could not exist to unify China, and the Tang Dynasty, who ruled China for 300 years following the Sui, could not have existed either, almost certainly changing the next 300 years of Chinese history and most probably the remainder of the whole country’s past. References

Shayuan
537
Northern Wei
Northern and Southern dynasties