Zhang Ni Zhang Ni ( died 254 ) , Boqi , was a military general of the state of Shu Han during the Three Kingdoms period . He was instrumental in pacifying the indigenous tribes residing within and around the border of Shu . He spent at least 18 years dealing with the continuum of domestic uprisings around Yuesou and Ba commanderies , and only entered the central government after numerous petitions . He was slain by Cao Wei ' s defending general , Xu Zhi , during one of Jiang Wei ' s Northern Expeditions . His name is sometimes rendered as " Zhang Yi " . Early life and career . Zhang Ni hailed from Ba commandery , and became a county clerk during his youth . During Liu Bei ' s takeover of Yi Province , bandits took the opportunity to ransack the county Zhang worked in . Overran by the rebels , Zhang Ni engaged close combat and protected the wife of his supervisor from the mob . This incident made him famous , and the commandery summoned his service . Later , the Sou tribes ( 叟 ) of Yuesui ( 越巂 ) rose up and retaliated Zhuge Liang ' s Southern Campaign by killing two officials who Shu - Han regime assigned as superintendents . Due the local resistance , future designated Administers of Yuesou dared not enter their appointed jurisdiction . As a result , Shu - Han could only claim its rule over the area , while the state was actually impuissant to control the commandary under collar . At this juncture , Zhang Ni was chosen as the new Administer . During his tenure , Zhang Ni successfully persuaded some tribes to recognize Shu - Han ' s rule , and he was rewarded with a marquis title in return . Zhang Ni stayed in Yuesui for three years until he was repatriated to his native commandery of Ba . Subjugation of the indigenous tribes . When Zhang Ni learned local tribes of Dingji ( 定莋 ) , Taideng ( 台登 ) , and Beishui ( 卑水 ) counties discovered iron and lacquer , he led his troops to pillage the counties and assigned officials to watch over the minorities . Zhang Ni himself moved to Dingji county , where he expected tribal leaders to personally greet him . However , an uncle of a tribal king , Lang Cen ( 狼岑 ) , who was trusted by the tribesmen , sent only representatives to the administrator ' s abode and refused to meet the rapacious Zhang Ni in person , because Lang Cen was indignant upon Zhang ' s previous plunder . In response , Zhang Ni led tens of his strongest guards to the reputable Lang Cen and flogged him to death . Zhang Ni then brought back the corpse to the tribal forum for public demonstration . Zhang Ni warned the public , " don ' t move ( don ' t try to take revenge ) ; otherwise , you will be killed . " Zhang Ni bribed the tribesmen and told them Lang Cen was evil , so the tribes surrendered . When Zhuge Liang was assembling Shu Han troops in Hanzhong , local bandits pillaged the villages , where the majority of male had been drawn to the frontier . Thus , Zhang Ni acted on the authority of a colonel and led the defensive forces to quash the rebels . However , the bandits dissembled and hid in different lairs when they got wind of Zhang ' s coming . Zhang Ni had difficulty engaging the bandits in battle , so he feigned " heqin " with the rebel leaders and coaxed them to join a banquet to celebrate the peace . After the leaders were intoxicated , Zhang Ni and his soldiers killed all 50 of them ; he then sent out troops to search and kill each of the mob . The massacre lasted ten days and the area was purged . For his effort , Zhang was promoted to " General of the Standard " ( 牙門將軍 ) , and worked under Ma Zhong ' s command . They subsequently quelled many uprisings and were feared by the different tribes around Shu - Han . Battle of Xiangwu , and death . Zhang Ni ' s finesse in dealing with the local tribes was highly appreciated by the central government of Shu - Han , but Zhang himself was not particularly enthusiastic at his current job as he had been on the same post for over 15 years . He solicited the emperor Liu Shan to let him join the central politics on numerous occasions , and his wish was finally granted in 254 . However , by the time he reached the capital of Chengdu , Zhang Ni had been plagued by an inveterate rheumatism for some years . In the same year , after Li Jian ( 李簡 ) , a Cao - Wei county magistrate of Didao , clandestinely contacted Shu - Han that he would defect , a meeting was held to discuss the issue . Many officials were concerned that the surrender might only be a ruse , but Zhang Ni argued against his colleagues and believed Li Jian was genuine ; in the end Liu Shan allowed Jiang Wei to start a campaign in accord with Li ' s defection . As Zhang Ni had just returned and been suffering from rheumatism , he was considered by many as incompatible for the upcoming operation . Still , Zhang Ni left Liu Shan saying he would rather die on a battlefield should the campaign fail in order to pay back the emperor ' s grace ; Liu Shan was moved and wept for the stricken general ' s speech . When the expedition force arrived in Didao , Zhang Ni ' s prediction was confirmed - Li Jian led his troops out from a fastness and surrendered the county . However , the campaign went amiss when the Shu - Han army pressed against the periphery of Xiangwu , where the county defensive force led by Xu Zhi struck back . Zhang Ni led a raid and inflicted a great damage on Xu Zhi ' s unit , forcing the defenders to retreat , but Zhang Ni also lost his own life in that encounter . In light of Zhang Ni ' s contribution , his eldest son , Zhang Ying ( 張瑛 ) , was enfeoffed as the Marquis of Xi Village , while the second son Zhang Huxiong ( 張護雄 ) succeeded the father ' s original marquis title . In fiction . In the historical novel " Romance of the Three Kingdoms " by Luo Guanzhong , Zhang Ni was a late Shu Han general . He participated in many of Zhuge Liang ' s campaigns and displayed a fiery passion for Zhuge ' s endeavors . Due to this , he sometimes found himself over his head and in dangerous situations , nearly being killed by Wang Shuang at Chencang before being rescued by Liao Hua and Wang Ping and being led into a trap and captured by Lady Zhurong during the Southern Campaign . While on his deathbed , Zhuge Liang named Zhang Ni , along with Liao Hua , Ma Dai , Wang Ping and Zhang Yi , as the loyal generals of Shu who should be retained after his passing . During Jiang Wei ' s Northern Expeditions , Zhang Ni often urged Jiang to concentrate on internal affairs rather than attacking Cao Wei . He forfeited his life in Chapter 111 , while saving Jiang Wei from Chen Tai .