Battle of Xinye

The Battle of Xianye occurred in 207 AD when the 30,000-strong army of Cao Cao, commanded by his cousin Cao Ren, invaded Jing Province with the goal of conquering the warlord Liu Biao's lands and arresting Cao Cao's rival Liu Bei. However, Liu Bei's new strategist Xu Shu succeeded in defeating Cao Ren's 30,000-strong army while commanding an army of a mere 4,000 troops, utilizing ambushes and a counter-strategy to the Eight Gates formation to destroy Cao Ren's force. Sadly, Xu Shu was forced to leave Liu Bei for Cao Cao's service shortly after, as Cao Cao took his mother hostage.

Background
After the Battle of Runan in 202 AD, the Governor of Jing Province Liu Biao was very generous to his fugitive relative Liu Bei, who led 30,000 of Liu Biao's troops in suppressing the uprising of Zhang Wu and Chen Sun in Jiangxia. Liu Biao came to trust Liu Bei and sent his sworn brother Zhang Fei to keep ward on the southern border of Yue, Guan Yu to guard Guzi against Zhang Lu in the west, and Zhao Yun to hold the Three Gorges against Sun Quan. The Imperial Protector's general Cai Mao did not approve of Liu Bei putting his troops in commanding positions around the region, and his sister Lady Cai attempted to discourage Liu Biao from letting Liu Bei stay in Xinye. Liu Bei even failed in his attempt to convince Liu Biao to march on Xuchang and liberate the emperor, and he was too late by the time that their rival Cao Cao had returned from Liucheng.

Cai Mao's plot
Liu Bei later advised Liu Biao to gradually reduce the power and influence of the Cai clan so that he could name his eldest son Liu Qi heir rather than his second son by Lady Cai Liu Cong. Lady Cai overheard the conversation and told her brother of Liu Bei's plotting, and Cai Mao planned to have Liu Bei assassinated as he bade farewell to his host. He had his brother Cai He posted on the road to the Xian Hills from the east gate and his brothers Cai Zhong and Cai Xun posted on the north and south roads, hoping to ambush Liu Bei. However, Yi Ji warned Liu Bei and thus thwarted the plot, as Liu Bei was able to leap over the Tan Torrent with his horse, a move considered impossible; Cai Mao had not even bothered to post guards at the rapids. As Cai Mao attempted to kill Liu Bei with his bow, Zhao Yun and 300 troops pursued Cai Mao, who fled back into Jingzhou. Zhao Yun, fearing an ambush, then started for Xinye. As Liu Bei rode towards Nanzhang, he met Xu Shu and Pang Tong, whom he recruitede into his service. Meanwhile, Sun Qian told Liu Biao of Cai Mao's plot, and Liu Biao was intent on executing Cai Mao until Sun Qian persuaded him that Cai Mao's execution would prevent Liu Bei from remaining in Jing Province. Cai Mao was then dismissed with a severe reprimand.

Cao Cao's plan
After his return from Ji Province, Cao Cao focused on the conquest of Jing Province. He sent Cao Ren and Li Dian and the brothers Lu Xiang and Lu Kuang with 30,000 troops to threaten Jingzhou and Xiangyang, sending spies there to find the weak points. The brothers reported that Liu Bei was encamped at Xinye and that, if they were given 5,000 troops, they could claim Liu Bei's head. Cao Ren approved, and the brothers set out with their force.

Battle
Liu Bei turned to Xu Shu for advice, and he had Guan Yu and Zhang Fei take 1,000 troops each and wait in ambush on the flanks, while Liu Bei and Zhao Yun would launch a frontal attack. Liu Bei and his 2,000 troops first met Lu Kuang, who informed Liu Bei that he had orders from Cao Cao to make him prisoner. Liu Bei sent out Zhao Yun, who speared Lu Kuang dead; Lu Xiang and his force then fled, and half of his men were slain in Guan Yu's ambush. After retreating for three more miles, Lu Xiang was cut down in one blow when Zhang Fei ambushed him, and most of them were killed or captured. Li Dian then advised Cao Ren to request reinforcements, but Cao Ren told off 25,000 troops to attack Xianye, refusing to follow Li Dian's advice. Zhao Yun defeated Li Dian in a duel, and Cao Ren again ignored Li Dian's advice to withdraw to Fancheng, nearly having Li Dian executed before other officers interceded on his behalf. Cao Ren's army instead formed the "Eight Gates" formation, and only the "Birth", "Exit", and "Expanse" gates would be vulnerable to Liu Bei's army. Zhao Yun and 500 troops fought their way to the center of the formation and drove back Cao Ren's army in disarray, and Xu Shu forbade pursuit. Cao Ren decided one last time to attack Liu Bei's army, hoping to surprise his camp or return to Fancheng if he failed. Liu Bei's army detected a night attack, so Cao Ren gave the order to withdraw; however, he was ambushed by Zhao Yun and Zhang Fei. Most of his soldiers drowned in a stream during the retreat, and they found that Guan Yu had occupied the empty Fan Castle during Cao Ren's assault. Guan Yu then ambushed and killed many of Cao Ren's troops, and his army was forced to return to Xuchang in defeat.

Aftermath
Liu Bei then rode to Fancheng and was warmly received by Magistrate Liu Mi, his relative; he then adopted his nephew Kou Feng as his own son "Liu Feng". Liu Bei then left Zhao Yun with 1,000 troops to guard Fancheng before returning to Xinye. When Cao Cao discovered Xu Shu's role in Cao Ren's defeat, he invited Xu Shu's widowed mother to the capital and treated her well, and he persuaded Xu Shu to leave Liu Bei's service, as he held his mother hostage. Before Xu Shu left, however, he told Liu Bei of a man living seven miles from Xiangyang whose intellect was greater than his own. Liu Bei visited this hermit, Zhuge Liang, three times before he was able to convince him to serve him.