Zhuo, Lü Bu came under attack by Dong Zhuo's followers, who were led by Li Jue and Guo Si. They defeated him and forced him out of the imperial capital, Chang'an. Zhang Liao accompanied Lü Bu as they headed east and wandered around central and northern China until mid 195, when the warlord Liu Bei offered Lü Bu shelter in Xu Province. In 196, Lü Bu betrayed his host and seized control of Xu Province, after which he appointed a 27-year-old Zhang Liao as the Chancellor of Lu State (魯國; around present-day Qufu, Shandong). Despite technically a subordinate of Lü Bu, Zhang Liao was formally independent from Lü Bu as he holds office as prefect of Beidi at that time. In 198, Lu Bu's men were ordered to buy military horses. However, all the gold was plundered by Liu Bei's army on the way. Therefore Zhang Liao fought Liu Bei's forces along with Gao Shun, which prompted Liu Bei to ask Cao Cao reinforcement, Cao Cao dispatched Xiahou Dun to help Liu Bei. However, Gao Shun and Zhang Liao first jointly defeated Xiahou Dun, and then jointly defeated Liu Bei at Peicheng. Service under Cao Cao In 198, the warlord Cao Cao, who controlled the Han central government and the figurehead Emperor Xian, defeated Lü Bu at the Battle of Xiapi and executed him. Zhang Liao surrendered to Cao Cao and became one of his subordinates. He was commissioned as a General of the Household (中郎將) and received the peerage of a Secondary Marquis (關內侯). He was promoted to Major-General (裨將軍) later for his contributions in battle. Persuading Chang Xi to surrender In early 201, after Cao Cao defeated his northern rival Yuan Shao at the Battle of Guandu, he first sent Zhang Liao to pacify the various counties in Lu State (魯國; around present-day Qufu, Shandong), and then ordered him and Xiahou Yuan to lead an army to attack a minor warlord Chang Xi (昌豨) in Donghai Commandery (東海郡; around present-day Linyi, Shandong). Zhang Liao and Xiahou Yuan had besieged Chang Xi for months but were unable to defeat him and their supplies were running out, so they considered retreating. Zhang Liao told Xiahou Yuan: "Over the past several days, whenever we attacked Chang Xi, I noticed he paid careful attention to me. He is also running short of arrows. I suspect he is having doubts, therefore he isn't