# Zhang Quanyi

Zhang Quanyi (Chinese: 張全義) (852 – April 29, 926), né Zhang Juyan (張居言) or Zhang Yan (張言), known as Zhang Zongshi (張宗奭) during Later Liang, courtesy name Guowei (國維), formally Prince Zhongsu of Qi (齊忠肅王), was a late Tang dynasty warlord who later was a senior official during the succeeding Later Liang and Later Tang. He was credited for rebuilding the city of Luoyang from utter destruction from the warfares in the late Tang period into a prosperous city.

## During the Tang dynasty
### Background and service under Huang Chao

Zhang Quanyi was born in 852, during the reign of Emperor Xuānzong. His biography in the History of the Five Dynasties indicated that he was originally named Zhang Juyan, and his biography in the New History of the Five Dynasties indicated that he was originally named Zhang Yan. His family was from Linpu (臨濮, in modern Heze, Shandong), and both his grandfather Zhang Lian (張璉) and father Zhang Cheng (張誠) were farmers. Zhang Quanyi himself served as a farm inspector for the Linpu County government, but in his service was often insulted by the county magistrate. Therefore, when, late in the Qianfu era (874–879) of Emperor Xuānzong's grandson Emperor Xizong, when the region was overrun by the major agrarian rebel Huang Chao, Zhang joined Huang's army. After Huang captured the Tang imperial capital Chang'an and forced Emperor Xizong to flee to Chengdu around the new year 881, Huang established a new state of Qi with himself as emperor. Zhang served in Huang's government as the minister of civil service affairs (吏部尚書, Libu Shangshu) and the director of transportation.

### Service under Zhuge Shuang and Zhuge Zhongfang

After Huang Chao was eventually defeated by Tang forces and chased out of Chang'an, Zhang Quanyi joined the army of the Tang general Zhuge Shuang the military governor (jiedushi) of Heyang Circuit (河陽, headquartered in modern Jiaozuo, Henan). He distinguished himself serving under Zhuge, and Zhuge eventually made him the prefect of Ze Prefecture (澤州, in modern Jincheng, Shanxi).
Zhuge died in 886. Zhang and another officer of Zhuge's, Liu Jing (劉經), supported Zhuge's son Zhuge Zhongfang (諸葛仲方) as acting military governor. Liu, however, controlled the governance of the circuit, drawing resentment from other officers. Late in 886, Liu became suspicious of the officer Li Hanzhi, and he decided to use Luoyang as a base to launch a surprise attack on Li's base at Minchi (澠池, in modern Luoyang). Li defeated him, however, forcing him to abandon Luoyang and flee north of the Yellow River back to the circuit capital Heyang. Li gave chase, and was about to chase the Yellow River, when Liu sent Zhang to try to stop Li. However, as Zhang also resented Liu's hold on the circuit governance, he instead joined Li, and they jointly attacked Heyang but could not capture it. They then withdrew to Huai Prefecture (懷州, in modern Luoyang).
As this Heyang Circuit internecine confrontation was going on, the former Tang general Qin Zongquan, who had declared himself emperor at Fengguo Circuit (奉國, headquartered in modern Zhumadian, Henan), sent his general Sun Ru toward Heyang, and Sun soon captured the city. Zhuge Zhongfang fled to Xuanwu Circuit (宣武, headquartered in modern Kaifeng, Henan). Sun thereafter claimed the title of military governor of Heyang. However, Zhang and Li occupied Huai and Ze Prefectures, respectively, and resisted Sun. After Qin thereafter suffered a major defeat at the hands of Xuanwu's military governor Zhu Quanzhong, Sun withdrew from Heyang. Zhang and Li rejoined forces, with Li taking over Heyang and Zhang taking over Luoyang; they then jointly sought aid from the major warlord Li Keyong the military governor of Hedong Circuit (河東, headquartered in modern Taiyuan, Shanxi). Li Keyong sent his officer An Jinjun (安金俊) to take over Ze Prefecture as prefect and to aid Li Hanzhi and Zhang; he also commissioned Li Hanzhi as the military governor of Heyang and Zhang as the mayor of Henan Municipality (河南, i.e., Luoyang).

### As vassal of Li Hanzhi/Li Keyong

At the time that Zhang Quanyi took over as the mayor of Henan, it was said by historical accounts that the city had been laid waste by the wars, with the remnants of the population gathered within three castles of the city, totaling less than 100 households. Zhang set up his headquarters at one of those castles, Zhongzhou (中州), while selecting 18 capable officers and sending them out to the 18 counties of the municipality other than the two in the city center, to be in charge of rebuilding their counties and welcoming the refugee population back. He simplified the laws, making murder the only capital offense, while the other offenses were punishable only by caning; he also exempted the people from taxes. As a result, the refugee population returned in droves, and he trained them in the military arts so that they could defend themselves. Within a few years, the city recovered to appearing to be like the old days before the wars, and the fields were no longer fallow, but filled with mulberries and hemp. It was said that the larger counties were capable of producing 7,000 soldiers, and the smaller counties 2,000. It was said that Zhang governed with intelligence and that his subordinates could not deceive him. He rewarded the households that was particularly good at farming wheat or sericulture with clothes and tea. Under his rule, Henan became a rich city again.
Meanwhile, Zhang initially had a cordial relationship with Li Hanzhi, whose Heyang Circuit his Henan Municipality belonged to, and they even cut their own arms to swear to be brothers. However, Li Hanzhi viewed Zhang's promotion of farming lightly. He also made a habit of making all kinds of material demands on Zhang, to the point that whenever he was not satisfied with what Zhang supplied his army, he would arrest Zhang's subordinates and cane them. Initially, Zhang put on the appearance of fearing Li Hanzhi and doing everything to appease him. In 888, when Li Hanzhi was on a campaign against the army of Huguo Circuit (護國, headquartered in modern Yuncheng, Shanxi), Huguo's military governor Wang Chongying sent secret emissaries to persuade Zhang to turn against Li Hanzhi. Zhang agreed, and he launched a surprise attack on Heyang at night, capturing it and taking Li Hanzhi's household captive. He then claimed the title of military governor of Heyang for himself.

### As vassal of Zhu Quanzhong

Li Hanzhi fled to Ze Prefecture and sought aid from Li Keyong. Li Keyong sent his officer Kang Junli, commanding five other officers (Li Cunxiao, Xue Atan (薛阿檀), Shi Yan (史儼), An Jinjun, and An Xiuxiu (安休休) to aid Li Hanzhi in trying to recapture Heyang. They put Heyang under siege, and the food supplies ran out. Zhang Quanyi thus sent his wife and children to Zhu Quanzhong as hostages to seek aid from him. Zhu sent his officers Ding Hui, Ge Congzhou, and Niu Cunjie (牛存節) to aid Zhang. They defeated the Hedong forces, and then postured to cut off the Hedong forces' return path to Hedong through the Taihang Mountains. In fear, Kang took his army and withdrew. Zhu commissioned Ding the acting military governor of Heyang and recommissioned Zhang as the mayor of Henan. It was said that because Zhang was appreciative of Zhu's saving his life, he never had any thoughts of turning against Zhu from this point on, and he plenteously supplied Zhu's army in Zhu's subsequent campaigns. Soon thereafter, Henan was turned into its own circuit (Youguo (佑國)), and then-reigning Emperor Zhaozong (Emperor Xizong's brother and successor) commissioned Zhang its military governor.
In 890, when the imperial government, at the request of Zhu's and that of Li Kuangwei the military governor of Lulong Circuit (盧龍, headquartered in modern Beijing, declared a general campaign against Li Keyong, Zhang led an army to participate in Zhu's operation, along with Ge and Zhu's son Zhu Youyu (朱友裕), to wrest Zhaoyi Circuit (昭義, headquartered in modern Changzhi, Shanxi) from Li Keyong's control. The campaign, however, eventually ended in failure when Li Keyong's main forces crushed the imperial forces commanded by the chancellor Zhang Jun, and Li Keyong was able to retain Zhaoyi at that point. Later in the year, Zhang received the honorary chancellor title of Tong Zhongshu Menxia Pingzhangshi (同中書門下平章事).
In 892, after Zhu, for reasons unclear to history, requested that then-military governor of Heyang, Zhao Keyu (趙克裕), be demoted, Zhang was made the military governor of Heyang, in addition to Youguo. (However, at some point, Ding was made acting military governor of Heyang again, and in 899 was made full military governor.)
In 896, by which time Emperor Zhaozong had fled to Zhenguo Circuit (鎮國, headquartered in modern Weinan, Shaanxi), which was then governed by Han Jian, due to attacks on Chang'an by Li Maozhen the military governor of Fengxiang Circuit (鳳翔, headquartered in modern Baoji, Shaanxi), Zhu Quanzhong and Zhang were submitted repeated joint petitions for the emperor to move the capital to Luoyang. In fear, Li Maozhen apologized to the emperor, repaired the palace and office buildings at Chang'an, and welcomed Emperor Zhaozong back to Chang'an.
In 898, Emperor Zhaozong bestowed the greater honorary chancellor title of Shizhong on Zhang.
In 900, when the eunuch Liu Jishu briefly overthrew Emperor Zhaozong in a coup and replaced him with his son Li Yu, Prince of De the Crown Prince, Zhang Jun, who had by that point retired to Changshui (長水), one of the counties of Henan, went to meet with Zhang Quanyi to encourage him and the other military governors to start a campaign to restore Emperor Zhaozong. There was no record of any actual action taken by Zhang Quanyi. (However, in 901, Emperor Zhaozong was restored in a countercoup headed by the imperial guard officers Sun Dezhao (孫德昭), Dong Yanbi (董彥弼), and Zhou Chenghui (周承誨). Shortly after, Zhang Quanyi was given the honorary chancellor title of Zhongshu Ling (中書令).
By 903, Zhu Quanzhong had taken Emperor Zhaozong under his control, and was planning on eventually usurping the Tang throne. He feared that Zhang Jun would again encourage the military governors to attack him. He thus ordered Zhang Quanyi to kill Zhang Jun. Zhang Quanyi sent his officer Yang Lin (楊麟) to take a group of soldiers, disguised as bandits, to attack Zhang Jun's mansion and slaughter his household. Only Zhang Jun's son Zhang Ge escaped the slaughter. Subsequently, Zhu Quanzhong destroyed Chang'an and moved Emperor Zhaozong to Luoyang. He then moved Zhang Quanyi to be the military governor of Tianping Circuit (天平, headquartered in modern Tai'an, Shandong. He also had Zhang created the Prince of Dongping.
In 904, by which point Zhu had assassinated Emperor Zhaozong and replaced him with his son Li Zuo the Prince of Hui (as Emperor Ai), Zhang Quanyi was again made the mayor of Henan; he was additionally also made the military governor of Zhongwu Circuit (忠武, headquartered in modern Weinan), apparently commanding it remotely, and the overall commander of the imperial guards.

## During Later Liang
### During Emperor Taizu's reign

In 907, Zhu Quanzhong had Emperor Ai yield the throne to him, ending Tang and starting a new Later Liang as its Emperor Taizu. He made Zhang Quanyi the military governor of Heyang, in addition to being the mayor of Henan, again, and created him the Prince of Wei. Soon thereafter, he changed Zhang Quanyi's name to Zhang Zongshi, apparently due to naming taboo as his own name included the character "Quan." In 908, in addition to his other offices, Zhang was also made Taibao (太保) and the military governor of Zhenguo Circuit (鎮國, headquartered in modern Sanmenxia, Henan). In 910, he was additionally made the military governor of Xuanyi Circuit (宣義, headquartered in modern Anyang, Henan.
In 911, Emperor Taizu spent the summer at Zhang's summer mansion. He used the opportunity to have sexual relations with virtually every woman in Zhang's household. Zhang's son Zhang Jizuo (張繼祚), humiliated, wanted to assassinate the emperor. Zhang Zongshi pointed out that it was because of Emperor Taizu's initially stopping Li Hanzhi's attack that the Zhang household was preserved, and he managed to persuade Zhang Jizuo not to carry out the assassination. (According to Zhang's biography in the New History of the Five Dynasties, the women that Emperor Taizu had sexual relations with included even Zhang Zongshi's wife Lady Chu and his daughters.)

### During Zhu Yougui's and Zhu Zhen's reigns

In 912, Emperor Taizu was assassinated by his son Zhu Yougui the Prince of Ying, who took the throne thereafter. As part of the governmental reorganization that took place after Zhu Yougui took the throne, he disbanded the headquarters for financial matters at the eastern capital Kaifeng (which previously had been the headquarters of Xuanwu Circuit while Zhu Quanzhong governed it), which Emperor Taizu had created and had named Jianchang Palace (建昌宮). The responsibility of overseeing the financial matters was transferred to Zhang Zongshi. Zhang was also made the military governor of Xuanwu Circuit (whose headquarters had been moved to modern Shangqiu, Henan by that point). In 913, Zhu Yougui's younger brother Zhu Youzhen the Prince of Jun overthrew him and took the throne, and subsequently moved the capital from Luoyang to Kaifeng, but it appeared that Zhang remained in charge of the financial matters of the state. In 917, Zhu Youzhen (who had changed his name to Zhu Zhen) further bestowed on Zhang the title of Deputy Generalissimo of All Circuits (天下兵馬副元帥). (The Generalissimo title belonged to Qian Liu the Prince of Wuyue, whose state was a Later Liang vassal state.)
In 921, Zhu Zhen, suspicious of the intentions of the major general Liu Xun, who had sought retirement, approved Liu's retirement and had him reside at Luoyang. He then ordered Zhang to poison Liu to death.
In 923, Zhu Zhen, with the territory of his Later Liang state north of the Yellow River gradually taken piece by piece by his rival Li Cunxu the Prince of Jin (Li Keyong's son and successor), planned a major counterattack. At the recommendation of his close associates Zhao Yan and Zhang Hanjie (張漢傑), he made the general Duan Ning, whose military abilities was not respected by the army, the overall commander of the operations. Zhang Zongshi, knowing that Duan was not the appropriate commander and that the army generals were more respectful of another general, Wang Yanzhang, submitted a petition stating:
   I, your subject, am the Deputy Generalissimo. Even though I am weak and old, I still have enough strength to defend the northern borders of the state. Duan Ning is a junior general whose achievements were insufficient to cause others to respect him. There are so many dissensions, and this may lead to great worries for the state.
Despite Zhang's petition (and similar remarks made by the chancellor Jing Xiang), Zhu Zhen continued to leave Duan in command. Subsequently, before Duan could start his operations, Li Cunxu made a surprise maneuver across the Yellow River around Duan's army, and directly attacked Kaifeng. Zhu Zhen, unable to resist and unable to flee, committed suicide. Li Cunxu, who had by that point declared himself the emperor of a new dynasty, Later Tang (as its Emperor Zhuangzong), and claimed to be the legitimate successor to Tang, entered Kaifeng and took over virtually all of the Later Liang territory.

## During Later Tang

The Later Liang military governors, including Zhang Zongshi, largely immediately submitted to the Later Tang emperor. In winter 923, Zhang went to Kaifeng to pay homage to Emperor Zhuangzong, and he changed his name back to Quanyi. He submitted a large amount of money and horses as tribute. Emperor Zhuangzong had his son Li Jiji and brother Li Cunji (李存紀) honor Zhang as an older brother. Subsequently, when Emperor Zhuangzong considered opening up the tomb of Emperor Taizu of Later Liang, Zhang, still grateful to Emperor Taizu for his survival, submitted a petition stating that while the two states were rivals, such an action at this point would be meaningless and would merely show Emperor Zhuangzong to be vengeful. Emperor Zhuangzong agreed and did not do so, although he still destroyed the memorials built for Emperor Taizu on his tomb. Soon thereafter, at Zhang's suggestion, Emperor Zhuangzong moved the capital to Luoyang. He bestowed on Zhang the title of Shangshu Ling (尚書令). He also changed Zhang's princely title to Prince of Qi.
In 924, Emperor Zhuangzong and his wife Empress Liu visited Zhang's mansion for a feast. At the feast, Empress Liu, claiming that she lost her parents in her youth and that she missed having parents, asked to treat Zhang as her father. Zhang, in fear, initially declined, but eventually accepted. Thereafter, Empress Liu and he often sent messengers back and forth, and he submitted much tribute to her.
In 926, Emperor Zhuangzong, who had alienated his soldiers due to his failure to properly reward them for their contributions during his campaigns, was facing a mutiny by the Weibo Circuit (魏博, headquartered in modern Handan, Hebei) army. He initially sent the general Li Shaorong to try to suppress the rebellion, but Li Shaorong was unable to do so. Zhang, instead, recommended the senior general, and Emperor Zhuangzong's adoptive brother, Li Siyuan. Upon Li Siyuan's arrival at Weibo, however, his own soldiers mutinied and forced Li Siyuan to join the Weibo soldiers in the rebellion. Li Siyuan subsequently led his army south, toward Kaifeng. When Zhang heard this, he became fearful as he was the one who had recommended Li Siyuan, and he stopped eating. He died soon thereafter.