Cao Cao suspected no treachery and gladly agreed. That night, Zhang Xiu led troops to raid Cao Cao's camp. Cao Cao, caught off guard, suffered a devastating defeat. The fierce general Dian Wei, in order to protect Cao Cao's escape, fought alone, wielding his dual iron halberds and repelling several waves of pursuers. During this, Dian Wei sustained dozens of wounds, blood flowing profusely, yet he still fought to the death without retreating. In the end, outnumbered, he exhausted his strength and died, his body propped against the camp gate, with none daring to approach.
Cao Cao fled in defeat. On the way, his eldest son Cao Ang, in order to save his father, offered his horse to Cao Cao and traveled on foot himself. As a result, Cao Ang and his nephew Cao Anmin both died in the chaos of battle. Cao Cao, grieving deeply over the loss of his beloved general and eldest son, wept, saying: 'I have lost my eldest son and beloved nephew, yet neither compares to Dian Wei!' He was overwhelmed with sorrow. This defeat at Wancheng cost Cao Cao dearly, and he nearly lost his life.
Now, Lü Bu, due to his secret dealings with Yuan Shu and his seizure of Liu Bei's Xuzhou, caused Cao Cao great concern. After settling the matter of Zhang Xiu, Cao Cao joined forces with Liu Bei and besieged Lü Bu in Xuzhou. Lü Bu held fast in Xiapi, relying on the city's strong fortifications and taking the situation lightly. His strategist Chen Gong presented several excellent plans, but none were adopted by Lü Bu. Lü Bu, due to excessive indulgence in wine and women, grew increasingly muddled. Chen Gong advised him to abstain from alcohol, which enraged Lü Bu, who said: 'I will kill you!' Chen Gong then said nothing more.
Cao Cao, following Guo Jia's plan, diverted water to flood the city, and Xiapi was submerged by the floodwaters. Lü Bu's army's morale collapsed. His generals Hou Cheng, Song Xian, and Wei Xu, deeply resentful of Lü Bu's tyranny, rebelled, stole Lü Bu's Fangtian Huaji and Red Hare, bound Lü Bu, and presented him to Cao Cao. Cao Cao, overjoyed at capturing Lü Bu, had him taken to the White Gate Tower.
When Lü Bu saw Cao Cao, he begged for mercy, saying: 'What you, illustrious lord, fear is none other than Lü Bu. Lü Bu has now submitted. If you, illustrious lord, obtain Lü Bu and order him to lead troops, why worry about pacifying the realm?'
Cao Cao was somewhat hesitant and asked Liu Bei: 'Xuande, what do you think?'
Liu Bei replied: 'Have you, my lord, forgotten the affairs of Ding Yuan and Dong Zhuo?'