Li Maozhen (; 856 – May 17, 924), born Song Wentong (), courtesy name Zhengchen (), formally Prince Zhongjing of Qin (), was the only ruler of the Chinese Five Dynasties and Ten Kingdoms period state Qi (901–924). He had become a powerful warlord during the reign of Emperor Zhaozong of Tang, the penultimate emperor of the preceding Tang dynasty, with his power centered on his capital Fengxiang (鳳翔, in modern Baoji, Shaanxi), and at times had effective control of Emperor Zhaozong. However, his power gradually waned due to defeats at the hands of fellow warlords Wang Jian (who would later found Former Shu) and Zhu Quanzhong (who would later found Later Liang). After Zhu usurped the Tang throne and established Later Liang, Li Maozhen refused to submit and continued to use the Tang-bestowed title of Prince of Qi as well as maintain the Tang era name, but his territory became even more reduced due to wars with Former Shu and Later Liang. After Later Liang was conquered by Later Tang, whose Emperor Zhuangzong claimed to be a legitimate successor of Tang, Li Maozhen submitted as a subject and was created the Prince of Qin in 924. He died soon thereafter, and was succeeded as by his son Li Jiyan as the military governor (Jiedushi) of Fengxiang, but as Li Jiyan was not made the Prince of Qi or Qin at that point (although he would receive both of those titles later in his life), this was typically viewed as the end of Qi as an independent state.
Background Song Wentong was born in 856, during the reign of Emperor Xuānzong of Tang. He was described as "from Boye" (博野, in modern Baoding, Hebei) — but was clearly not born there, as his family had, for generations, belonged to the Boye Army, which originally belonged to Chengde Circuit (成德, headquartered in modern Shijiazhuang, Hebei) that had its origins from Boye, but which had been stationed near the Tang imperial capital Chang'an ever since its commander Li Huan () refused to submit to Wang Tingcou, who had seized Chengde Circuit and rebelled against the imperial government, as Li Huan eventually fought his way out of attacks by Wang and took his army to the Chang'an region.Zizhi Tongjian, vol. 242. Song Wentong's grandfather was named Song Duo (); his grandmother was a Lady Zhang; his father was named Song Duan (); his mother was a Lady Lu, who later received the title of Lady Dowager of Yan.
During reign of Emperor Xizong of Tang Song Wentong apparently became an officer in the Boye Army, which was then stationed at Fengtian (奉天, in modern Xianyang, Shaanxi), in his youth. When the major agrarian rebel Huang Chao captured Chang'an around the new year 881 and forced then-reigning Emperor Xizong (Emperor Xuānzong's grandson) to flee to Chengdu, the Boye Army moved to Fengxiang Circuit and followed the orders of Fengxiang's military governor (Jiedushi), the former chancellor Zheng Tian. When Huang sent his major general Shang Rang to attack Zheng, Zheng repelled Shang; in that battle, Song distinguished himself, and thereafter was made a commander in the imperial Shence Army. During his service there, he was once favored by the powerful eunuch Tian Lingzi who adopted him as his son with the name Tian Yanbin ().New Book of Tang, vol. 208.
In 886, Emperor Xizong, who had returned to Chang'an after Huang's defeat, was again forced to flee Chang'an, to Xingyuan (興元, in modern Hanzhong, Shaanxi) after his trusted eunuch advisor Tian Lingzi got into a confrontation with the warlords Wang Chongrong the military governor of Huguo Circuit (護國, headquartered in modern Yuncheng, Shanxi) and Li Keyong the military governor of Hedong Circuit (河東, headquartered in modern Taiyuan, Shanxi) and was subsequently defeated by Wang Chongrong and Li Keyong. Two other warlords, Zhu Mei the military governor of Jingnan Circuit (靜難, headquartered in modern Xianyang) and Li Changfu the military governor of Fengxiang, who had previously been allied with Tian, turned against Emperor Xizong as well and supported his distant relative Li Yun the Prince of Xiang as a rival emperor at Chang'an. Zhu subsequently sent his general Wang Xingyu to advance on Xingyuan to try to capture Emperor Xizong, and Wang Xingyu initially defeated the imperial guard general Yang Sheng (). In response, Emperor Xizong sent Song, Li Chan (), and Chen Pei () to station themselves at Mount Datang (大唐峰, in modern Hanzhong) to defend against Wang Xingyu. Wang Xingyu was unable to advance and later, after enticement by Tian's successor and the leading eunuch Yang Fugong, turned against Zhu and killed him. Li Yun fled to Wang Chongrong's territory but was killed by Wang Chongrong.Zizhi Tongjian, vol. 256. For Song's accomplishments, Emperor Xizong bestowed the imperial surname of Li on him and gave him a new personal name of Maozhen ("prosperous and faithful") as well as a courtesy name of Zhengchen ("rightful subject"). In spring 887, Emperor Xizong made him the military governor of Wuding Circuit (武定, headquartered in modern Hanzhong).
In 887, when Emperor Xizong stopped at Fengxiang on his way back to Chang'an at the request of Li Changfu (who had also turned against Zhu), the imperial guards got into a confrontation with Li Changfu's troops, which turned into a full battle at Fengxiang. The imperial guards defeated Li Changfu's troops, and Li Changfu fled to Long Prefecture (隴州, in modern Baoji), which was part of Fengxiang Circuit. Emperor Xizong put Li Maozhen in command of an army attacking Long. Later in the year, under Li Maozhen's attack, Li Maozhen's subordinate Xue Zhichou () the prefect of Long slaughtered Li Changfu and his family and then surrendered. Subsequently, Emperor Xizong made Li Maozhen the military governor of Fengxiang and gave him the honorary chancellor title of Tong Zhongshu Menxia Pingzhangshi ().Zizhi Tongjian, vol. 257.
During reign of Emperor Zhaozong of Tang
Initial expansion of power In 888, Emperor Xizong died. His younger brother Li Jie the Prince of Shou, supported by Yang Fugong, became emperor (as Emperor Zhaozong). Emperor Zhaozong bestowed a number of honors on military governors, including the greater honorary chancellor title of Shizhong () on Li Maozhen.
Despite Yang's having supported him to be emperor, Emperor Zhaozong eventually had a fallout with him. In 891, after Emperor Zhaozong suspected Yang of plotting a coup with his adoptive nephew Yang Shouxin () and attacked his mansion, Yang fled to Shannan West Circuit (山南西道, headquartered at Xingyuan), which was then governed by his adoptive nephew Yang Shouliang. There he declared a rebellion against Emperor Zhaozong with Yang Shouliang, Yang Shouxin, and other adoptive sons and adoptive nephews including Yang Shouzhong () the military governor of Jinshang Circuit (金商, headquartered in modern Ankang, Shaanxi), Yang Shouzhen the military governor of Longjian Circuit (龍劍, headquartered in modern Mianyang, Sichuan), and Yang Shouhou () the prefect of Mian Prefecture (綿州, in modern Mianyang).Zizhi Tongjian, vol. 258. In spring 892, Li Maozhen reacted by submitting a joint petition with his older brother Li Maozhuang () the military governor of Tianxiong Circuit (天雄, headquartered in modern Tianshui, Gansu) and allies Wang Xingyu (who had been made the military governor of Jingnan), Han Jian the military governor of Zhenguo Circuit (鎮國, headquartered in modern Weinan, Shaanxi), and Wang Xingyu's brother Wang Xingyue () the military governor of Kuangguo Circuit (匡國, headquartered in modern Weinan as well), requesting that a campaign be launched against the Yangs and that Li Maozhen be made the commander of the operations. Emperor Zhaozong, concerned that if Li Maozhen defeated the Yangs, he would be even more difficult to control, initially ordered that the sides negotiate. However, Li Maozhen and Wang Xingyu, ignoring the edict, launched the campaign, and Li Maozhen wrote disrespectful letters to the chancellor Du Rangneng and the leading eunuch Ximen Junsui (). Emperor Zhaozong, concerned that Li Maozhen may slaughter the people of Shannan West without imperial sanction, made Li Maozhen the commander of the operations against the Yangs. Subsequently, when Emperor Zhaozong killed the imperial guard officer Li Shunjie () — who had previously been an adoptive son of Yang Fugong's but who had revealed much of Yang Fugong's secrets to Emperor Zhaozong — and Li Shunjie's ally Jia Desheng (), Jia's troops fled to Fengxiang and joined Li Maozhen, greatly strengthening Li Maozhen's army.Zizhi Tongjian, vol. 259.
In fall 892, Li Maozhen captured Feng Prefecture (鳳州, in modern Baoji), forcing Yang Fugong's follower Man Cun () the military governor of Ganyi Circuit (感義, headquartered at Feng Prefecture) to flee to Xingyuan. Li Maozhen then also captured Xing () and Yang () Prefectures (both in modern Hanzhong), and had his relatives take over as prefects of those prefectures. Soon thereafter, he captured Xingyuan, forcing Yang Fugong, Yang Shouliang, Yang Shouxin, Yang Shouzhen, Yang Shouzhong, and Man to flee to Lang Prefecture (閬州, in modern Nanchong, Sichuan). He had his adoptive son Li Jimi () take over as the acting mayor of Xingyuan. Meanwhile, seeing an opening to further expand his influence when Wang Jian the military governor of Xichuan Circuit (西川, headquartered in modern Chengdu, Sichuan) and Gu Yanhui the acting military governor of Dongchuan Circuit (東川, headquartered in modern Mianyang), who were previously allies, had a break (over Wang's apparent attempt to take over Dongchuan), Li Maozhen also recommended to Emperor Zhaozong that Gu be made full military governor; Emperor Zhaozong followed that recommendation. Thereafter, he sent Li Jimi to try to aid Gu, but after Xichuan troops defeated the joint Dongchuan/Fengxiang troops at Li Prefecture (利州, in modern Guangyuan, Sichuan), Gu sought peace with Wang under the term that he agreed to cut off relations with Li Maozhen; Wang agreed.
Confrontations with the imperial government In spring 893, Li Maozhen submitted a petition to Emperor Zhaozong stating that he was willing to be the military governor of Shannan West — apparently believing that Emperor Zhaozong would allow him to govern both Fengxiang and Shannan West. Instead, Emperor Zhaozong, who wanted to take Fengxiang back under imperial control, issued an edict making Li Maozhen the military governor of Shannan West and Wuding Circuits while making the chancellor Xu Yanruo the military governor of Fengxiang. Apparently to placate Li Maozhen, as part of the edict, two prefectures (Lang and Guo (果州, in modern Nanchong)) were made part of Wuding. Still, Li Maozhen, disappointed at being stripped of Fengxiang, refused to comply. He further sent arrogant petitions to Emperor Zhaozong deriding him for being unable to defeat the Yangs and unable to control the warlords, and harshly-worded letters to Du Rangneng. Emperor Zhaozong, in anger, decided to prepare a campaign against Li Maozhen, disregarding Du's analysis that the imperial government had insufficient strength to defeat Li Maozhen at that time and further putting Du in charge of planning the operations. Li Maozhen, however, found out what Emperor Zhaozong was planning, as Du's fellow chancellor, Cui Zhaowei, was an ally of both Li Maozhen and Wang Xingyu and was secretly revealing the events at court to them. Li Maozhen tried to ward of Emperor Zhaozong's plans by mobilizing supporters at Chang'an to protest the campaign, but Emperor Zhaozong was not swayed.