During the Battle of Xiapi, Cao Cao defeated Lü Bu in the initial stages and forced him to retreat back to Xiapi Commandery (下邳郡; south of present-day Pizhou, Jiangsu). Cao Cao then laid siege to Xiapi and launched several attacks but was unable to breach the city walls. As his troops grew weary, Cao Cao considered withdrawing. However, Xun You and Guo Jia advised him, "Lü Bu is brave but foolhardy. His forces' morale is very low after suffering consecutive defeats. An army's morale depends on its commander's will to fight on. Chen Gong is intelligent but slow. Since Lü Bu's army's morale hasn't recovered yet and Chen Gong hasn't finalised his plans yet, you can eventually defeat Lü Bu if you continue attacking him." Cao Cao then ordered his troops to dig ditches and redirect the waters of the Yi and Si rivers to flood Xiapi. Xiapi fell quickly and Lü Bu was captured alive and executed.