In 22, when
Liu Xiu and others revolted against
Wang Mang, Zhang Bu and his brothers also led thousands of soldiers and conquered, first his hometown Buji County (, in modern
Qingdao), and later, the entire
Langya Commandery. He called himself the Five Majestic General (). In 23, the
Han Gengshi Emperor (Liu Xuan) in
Luoyang began a policy of recognizing independent warlords in hopes of winning their support. Liu dispatched messengers to Zhang Bu and granted him the title General-in-Chief Who Supports Han (). Zhang Bu's brothers Zhang Hong (), Zhang Lan (), and Zhang Shou () all received titles. Meanwhile, Zhang Bu enlarged his territory by capturing the
Taishan,
Chengyang,
Donglai,
Gaomi,
Jiaodong,
Beihai,
Qi, and
Jinan Commanderies, gaining effective control of most of the
Shandong Peninsula. The Gengshi Emperor tried to test Zhang Bu's "loyalty" by sending Wang Hong () to Langya to serve as its administrator, but Zhang Bu refused to let him take office. Wang Hong attacked Zhang Bu and took
Ganyu and five other counties, but was unable to overcome Zhang Bu's dominance in the area. In 24, the Prince of Liang
Liu Yong turned against the Gengshi Emperor and became independent. Seeking Zhang Bu's support, Liu Yong confirmed his title, gave him the enfeoffment Marquis Zhongjie (, "the loyal and continent marquis"), and granted him the right to
Qing Province and
Xu Province. Zhang Bu accepted this arrangement. Their alliance frightened Wang Hong, who decided to submit to Zhang Bu and become his subordinate. Zhang Bu allowed him to administer Langya Commandery. In 26, Liu Xiu (Emperor Guangwu of Han) defeated Liu Yong and sent Fu Long () to Zhang Bu to solicit his allegiance. Zhang Bu sent a messenger to go to Luoyang with Fu Long as a show of submission. In 27, however, Liu Xiu only named Zhang Bu the Administrator of Donglai even though Zhang controlled twelve commanderies. Heeding Wang Hong's advice, Zhang Bu also refused to recognize Liu Yong's son Liu Yu (). ==Defeat and surrender==