Wang Jian (; 847 – July 11, 918), courtesy name Guangtu (光圖), also known by his temple name as the Emperor Gaozu of Former Shu (前蜀高祖), was the founding emperor of the Chinese Former Shu dynasty during the Five Dynasties and Ten Kingdoms period. He started his career as an army officer under the Tang dynasty eunuch generals Yang Fuguang and Tian Lingzi, eventually seizing control of the modern Sichuan and Chongqing region, founding his state after Tang's destruction.

Background Wang Jian was born in 847, during the reign of Emperor Xuānzong of Tang. He was from Wuyang (舞陽, in modern Luohe, Henan), and was said to be ambitious and alert in his youth. However, he was also described to be a hoodlum, abandoning his ancestral craft of baking to be involved in butchering cattle, stealing donkeys, and privateering in salt. His father died while he was still a commoner. At one point, for misdeeds, he was incarcerated at the jail at Xuchang (許昌, in modern Xuchang, Henan), the capital of Zhongwu Circuit (), which Wuyang sat in, but the jailers privately released him. He subsequently stayed with the monk Chuhong () in the Wudang Mountains, and Chuhong encouraged him to change his ways, predicting that there would be great accomplishments in his future. He thus joined the Zhongwu Circuit army and became an officer under then-military governor (Jiedushi) Du Shenquan.Spring and Autumn Annals of the Ten Kingdoms (十國春秋), vol. 35.

Early career

Service under Yang Fuguang As of 881, the major agrarian rebel Huang Chao had captured the Tang capital Chang'an, forcing then-reigning Emperor Xizong to flee to Chengdu. Zhongwu's then-military governor Zhou Ji initially submitted to Huang, who established a new state of Qi as its emperor, but at the urging by the eunuch general Yang Fuguang redeclared allegiance to Tang in summer 881. Yang took 8,000 Zhongwu troops and organized them into eight corps, commanded by Lu Yanhong, Jin Hui (), Wang Jian, Han Jian, Zhang Zao (), Li Shitai (), and Pang Cong () respectively. He then took the troops northwest to join the other Tang troops in campaign against Huang.Zizhi Tongjian, vol. 254.

Service under Lu Yanhong Yang Fuguang died in 883 while stationed at Hezhong Circuit (河中, in modern Yuncheng, Shanxi) and still fighting against Huang. Instead of continuing to fight against Huang, Lu Yanhong decided to take his troops and rove around the region, pillaging as he went.Zizhi Tongjian, vol. 255. Wang Jian, Han Jian, Zhang Zao, Jin Hui, and Li Shitai followed him as well.Zizhi Tongjian, vol. 256. Later in 883, Lu captured Xingyuan (興元, in modern Hanzhong, Shaanxi) the capital of Shannan West Circuit (), expelling the military governor Niu Xu () and claiming the title of acting military governor. He commissioned Wang and the other Zhongwu corps commanders as prefects within Shannan West, but did not allow them to actually report to their prefectures. He was particularly suspicious of Wang and Han because of their deep friendship, but wanting to comfort them, he often treated them well. Wang and Han realized Lu's intentions, however, and in fall 884, with Emperor Xizong's trusted eunuch Tian Lingzi secretly tempting them with offers of good treatment, they, along with Zhang, Jin, and Li, abandoned Lu and fled to Chengdu to serve under Tian.

Service under Tian Lingzi Tian Lingzi subsequently reorganized the Zhongwu troops that Wang Jian and the others commanded into a group of imperial guards directly under Tian's command, while sending imperial troops to attack Lu Yanhong, defeating him and forcing him to abandon Shannan West. Tian also adopted Wang and the others as his sons. Meanwhile, with Huang Chao having been defeated earlier, Emperor Xizong returned to Chang'an, in spring 885, with Tian and his troops accompanying him.

Soon after Emperor Xizong returned to Chang'an, however, Tian got into a major dispute with Wang Chongrong the military governor of Hezhong over control of two salt ponds at Hezhong, which Tian wanted to use the revenue from to support the imperial Shence Armies. Wang Chongrong refused to yield control, and soon, a full confrontation between Tian and his allies (Zhu Mei the military governor of Jingnan Circuit (靜難, headquartered in modern Xianyang, Shaanxi) and Li Changfu the military governor of Fengxiang Circuit (鳳翔, headquartered in modern Baoji, Shaanxi)) and Wang Chongrong and his ally Li Keyong the military governor of Hedong Circuit (河東, headquartered in modern Taiyuan, Shanxi) occurred. In winter 885, Wang Chongrong's and Li Keyong's forces defeated those of Tian, Zhu, and Li Changfu. As Li Keyong's forces approached Chang'an, Tian escorted Emperor Xizong and fled again, initially to Fengxiang and then to Xingyuan when Zhu and Li Changfu also turned against him. During this flight, with Emperor Xizong's flight path blocked by waves of refugees, Wang Jian and Jin cleared the path, killing all in their way, to allow Emperor Xizong through, and during the confusion, Emperor Xizong had Wang Jian bear the imperial seal, and at night slept on Wang Jian's knees.

With Tian realizing that the whole empire was against him by this point, he resigned while Emperor Xizong was at Xingyuan, recommending Yang Fuguang's brother Yang Fugong to succeed him as the commander of the Shence Armies, while having himself commissioned as the eunuch monitor of Xichuan Circuit (西川, headquartered at Chengdu) to join his brother Chen Jingxuan the military governor of Xichuan. Yang Fugong, not wanting Tian's trusted officers near him, had Wang, Jin, Zhang, and Li Shitai all sent out to prefectures to serve as prefect, with Wang becoming the prefect of Li Prefecture (利州, in modern Guangyuan, Sichuan). After Yang Fuguang's adoptive son Yang Shouliang became military governor of Shannan West in spring 887, Wang became titularly his subordinate.

Service under Yang Shouliang Yang Shouguang was apprehensive about Wang Jian's fighting ability and tried to summon him to Xingyuan several times, but Wang, fearful of Yang's intentions, refused the summons. At the suggestion of his subordinate Zhou Xiang, who pointed out that Li Prefecture was not an ideal defense position, he attacked Lang Prefecture (閬州, in modern Nanchong, Sichuan), expelled the prefect Yang Maoshi (), and took over Lang, claiming the greater title of defender. At the advice of Zhang Qianyu () and Qiwu Jian (), he submitted humble petitions to Emperor Xizong and comforted the people. He also entered into friendly relations with Gu Yanlang the military governor of Dongchuan Circuit (東川, headquartered in modern Mianyang, Sichuan), as the two were colleagues previously at the Shence Armies.

Campaign against Chen Jingxuan Chen Jingxuan, however, feared the close alliance between Gu Yanlang and Wang Jian and was worried that Gu and Wang would attack him. He discussed the situation with Tian Lingzi. Tian opined that he, as Wang's adoptive father, could summon Wang and make him serve under Chen. Chen agreed and allowed Tian to do so in winter 887. Wang, after receiving the summons, was initially happy about the summons. He, leaving most of his family at Dongchuan's capital Zi Prefecture () with Gu, took 2,000 men, along with his nephew Wang Zonghui () and his adoptive sons Wang Zongyao (), Wang Zongbi, Wang Zongkan (), Wang Zongji, and Wang Zongbian (), and headed toward Chengdu. While Wang was en route to Chengdu, however, Chen's subordinate Li Ai () convinced Chen that Wang was not to be trusted, and Chen decided to try to stop Wang's advance. Wang, in anger, refused, defeating officers that Chen sent to stop him and advancing all the way to Chengdu. He was unable to capture it quickly, even with the assistance of Gu Yanlang's brother Gu Yanhui, so both he and Gu Yanhui withdrew to Han Prefecture (漢州, in modern Deyang, Sichuan). Their hostilities continued, despite efforts by Emperor Xizong to mediate. It was said that Wang's army pillaged all 12 prefectures of Xichuan Circuit.Zizhi Tongjian, vol. 257.

However, Wang's attacks were stifled by Chengdu's strong defenses, and his supplies soon ran low. By summer 888, he considered abandoning the campaign altogether, but after Zhou Xiang and Qiwu Jian convinced him otherwise, continued the campaign. He, believing that he needed imperial sanction in order to succeed in the campaign, had Zhou draft a petition for him to Emperor Zhaozong — Emperor Xizong's brother, who succeeded Emperor Xizong after Emperor Xizong died early in 888 — asking to be given the rich Qiong Prefecture while asking the emperor to send a new military governor of Xichuan, offering to assist the new military governor. Gu Yanlang also submitted a petition requesting that Chen be moved from his post. Emperor Zhaozong, who had previous grudges against Tian and Chen for Tian's ill treatment of him while he was an imperial prince, issued an edict summoning Chen back to Chang'an to serve as an imperial guard general, while making the chancellor Wei Zhaodu the new military governor of Xichuan. When Chen subsequently refused the summons, Emperor Zhaozong stripped him of all of his titles and put Wei in charge of the operations against him, with Yang Shouliang, Wang, and Gu assisting him. Emperor Zhaozong also carved out four prefectures from Xichuan and made it into a new Yongping Circuit, with its capital at Qiong, for Wang to serve as military governor. In spring 890, Wang put Qiong Prefecture under siege. Around the same time, Wei arrived in Chengdu's vicinity, and Wang outwardly honored him greatly. A number of prefectures began to submit to Wang, and in winter 890, Qiong fell to him, allowing him to use Qiong as his basis of operations.Zizhi Tongjian, vol. 258.

However, in spring 891, with imperial forces having recently conducted a failed campaign against Li Keyong and the imperial treasury drained, Emperor Zhaozong decided to abandon the campaign against Chen. He restored Chen's titles and ordered Gu and Wang to return to their posts at Dongchuan and Yongping. Wang, believing that Chengdu was on the verge of falling, decided to disobey the imperial orders and continue the campaign. He intimidated Wei by having Dongchuan soldiers arrest and execute Wei's associate Luo Bao () on charges of corruption, and Wei transferred the command of the army to him. Wang continued the siege against Chengdu, and a famine began in the city. In fall 891, after Wang made assurances that he would continue to respect Chen and honor Tian as a father, Chen and Tian surrendered Chengdu. Emperor Zhaozong soon made Wang the military governor of Xichuan, merging Yongping back into Xichuan.

As military governor of Xichuan

Campaign against Dongchuan It was said that Wang Jian, after he took over Xichuan, ruled it diligently, listened to good advice, promoted capable people, put people in rightful positions, and was humble and frugal. However, he was also said to be suspicious, and that many subordinates with accomplishments suffered deaths due to his suspicions of them.