Lü Bu and his men fled east to join Liu Bei, who had succeeded Tao Qian as Governor (州牧) of Xu Province.
In the same year, Lü Bu took advantage of the conflict between Liu Bei and Yuan Shu to capture Xiapi (present-day Pizhou, Jiangsu), capital of Xu Province, effectively seizing control of the province from Liu Bei.
Liu Bei was forced to surrender his governorship of Xu Province to Lü Bu and settle in the nearby city of Xiaopei.
Lü Bu initially agreed to the proposal and sent his daughter to follow Han Yin back.
However, Lü Bu still bore a grudge against Yuan Shu for attacking him five years before, so he changed his mind after listening to Chen Gui.
On the other hand, Yuan Shu was angered by Lü Bu's betrayal, so he sent his generals Zhang Xun (張勳) and Qiao Rui (橋蕤) to lead an army to attack Xiapi from seven directions in collaboration with the White Wave Bandits led by Han Xian and Yang Feng.
He was afraid that he might not be able to resist Yuan Shu so he blamed Chen Gui for giving him poor counsel.
When Lü Bu attacked Yuan Shu's forces, Han Xian and Yang Feng defected to his side.
Yuan Shu's troops were defeated and Lü Bu pursued them until he reached south of the Huai River.
In 198, Lü Bu made peace with Yuan Shu again, and sent his general Gao Shun to attack Liu Bei at Xiaopei.
Xiaopei fell to Lü Bu's forces in October 198 and Liu Bei escaped, but his wives were captured.
Lü Bu personally led his troops out to engage the enemy but was defeated and forced to retreat.
Chen Gong advised Lü Bu to garrison part of his forces outside the city, while the rest would remain with him inside, so that they can support each other if either side came under attack.
Lü Bu agreed with the plan and wanted to leave Chen Gong and Gao Shun behind to defend Xiapi while he was stationed outside the city.
The beleaguered Lü Bu prepared to surrender after Xiapi was flooded for over a month, but Chen Gong stopped him.
He ordered the dead bodies of Lü Bu, Chen Gong, Gao Shun and others to be decapitated and their heads sent to Xuchang and then later buried.
Other minor warlords such as Zang Ba, Sun Guan (孫觀), Wu Dun (吳敦), Yin Li, and Chang Xi (昌豨) who used to side with Lü Bu also surrendered to Cao Cao, and he put them in charge of various commanderies along the coastline.
Some fictional events were added, while actual ones were modified to large extents for dramatic effect.
Cao Xing was caught off guard and was killed by Xiahou Dun, who speared him in the face.
[14] The only record of Cao Xing in history exists in the Yingxiong Ji (英雄記; Records of Heroes), which stated that when Hao Meng rebelled against Lü Bu in 196, Hao's subordinate Cao Xing refused to join him in the rebellion.
His subordinate Hou Cheng seized back 15 horses stolen from them and Lü Bu's men wanted to celebrate.
Hou Cheng later plotted with Song Xian and Wei Xu to betray Lü Bu.
[3] The Jiuzhou Chunqiu gave a similar account of the story in Romance of the Three Kingdoms, except that Lü Bu did not have Hou Cheng flogged when the latter presented wine to him.
Instead, Hou Cheng became afraid after Lü Bu scolded him and threatened to execute him, so he discarded the wine and returned to join the other generals.
[4] Lü Bu was resting when his subordinates Song Xian and Wei Xu captured him and tied him up.
Lü Bu then said to Hou Cheng, Wei Xu and Song Xian, "I treated all of you well, why do you betray me?"
As he was being dragged away, Lü Bu turned back and shouted at Liu Bei, "Big eared fellow!
[16] The Sanguozhi stated that Lü Bu surrendered when he saw that he had been surrounded, instead of him being captured by his own subordinates who had betrayed him.
He ordered Lü Bu's dead body to be decapitated and the head sent to the capital Xuchang and later had it buried.
The Battle of Xiapi is featured in Koei's video game series Dynasty Warriors as a playable stage from the fourth instalment onwards.