This act of distrust proved to be the last straw for Yuan Tan, as he rebelled from his younger brother and attacked the city of Ye in anger.
[2] Cao Cao's advisor Xun Yu, who long advocated settling the north before turning elsewhere, reasoned that Liu Biao was not ambitious enough to be a threat, and it was high time to reap the benefits of the Yuan family feud before the brothers reunite.
Attacking an enemy distressed and desperate, striking a rebel discouraged and weary, with your power, it will be like strong wind moving the autumn leaves.
[...] If, on the other hand, you fail to settle them now and decide to wait another year, then next harvest there may be grain, and your enemies will have recognised their errors.
After storming Yin Kai's fortress Maocheng (毛城) at the foot of the Taihang Mountains, Cao Cao's army bypassed the defenses at Ye and defeated Ju Hu (沮鵠) in Handan, north of Ye.
Shen Pei found out and had boulders dropped into the opening, blocking the gates and killed the roughly 300 soldiers who entered.
Then, in a single night, Cao Cao dug the trench further, 20 feet wide and 20 feet deep, drawing water from the nearby Zhang River to the west and encompassing the Yanpi Marsh (晏陂澤) to the south and the Huan River to the east and north.
Yuan Shang sent his Registrar (主簿) Li Fu (李孚) ahead to notify the defenders that relief was coming.
To avoid detection by the besiegers, Li Fu brought only three horsemen, broke his staff of authority, and traveled by night.
Turning west from here, he arrested the officers on picket duty, tied them up, then made a dash to the city walls.
During the night, several thousand people selected were sent away through three different gates, carrying white flags to surrender.
Li Fu and his followers blended into the crowd and exited Ye by the northern gate, then escaped the surrounding camps from the northwest.
Cao Cao pointed out that he should indeed avoid battle with the reinforcements if Yuan Shang came on the main road from the east; but if Yuan Shang moved across to the northwestern hills, he would have friendly territory (Gao Gan's Bing province) behind him and his army would be easier to deal with.
"[12] From the western hills, Yuan Shang turned east to Yangping village (陽平亭), 17 li from Ye.
Shen Pei made a sortie to the north to rendezvous with Yuan Shang, but Cao Cao defeated both armies, driving Shen Pei back within the walls and Yuan Shang to Quzhang (曲漳), a bend on the Zhang River.
[13] As Cao Cao's men breached the city, Shen Pei executed the families of Xin Pi's brother Xin Ping, whom he considered traitorous and responsible for the downfall of the Yuan clan, then personally joined the defense at the gates.
Shen Pei and the remaining defenders were pushed into the city proper, where fighting continued in the streets for a while.
[14] Whatever the circumstance, Shen Pei was captured alive, and the siege finally ended after dragging on for more than half a year.
On the execution grounds, Shen Pei demanded to be allowed to face north as he died, since his lord Yuan Shang was in that direction.
All these gained him wide popularity, which, along with the contingents of Bing Province troops sent to settle at Ye, prevented the outbreak of rebellion in favour of the former rulers.
[16] For the most part, the fall of Ye removed the Yuan clan's power from Ji province.
Over the years the city and its surrounding Wei Commandery became the heart of Cao Cao's power, as he initiated several works in and around the city, including the much-celebrated Bronze Bird Terrace and the Xuanwu Pond (玄武池), where he trained his navy.
According to Shui Jing Zhu, Ye was regarded as the Northern Capital during the Wei dynasty.