# Wei Yan

Wei Yan (pronunciation) (died c. October 234), courtesy name Wenchang, was a Chinese military general and politician of the state of Shu Han during the Three Kingdoms period of China. Originally a subordinate of the warlord Liu Bei during the late Eastern Han dynasty, Wei Yan rose through the ranks and became a general after Liu Bei seized control of Yi Province (covering present-day Sichuan and Chongqing) in 214. His performance in battle helped him to become a prominent figure in the Shu military in a short period of time. He was later appointed as the Administrator of Hanzhong Commandery and as an Area Commander in 219. Between 228 and 234, he participated actively in the Northern Expeditions led by the Shu regent Zhuge Liang against Shu's rival state, Cao Wei. After Zhuge Liang's death in c. September 234, Wei Yan was executed by another Shu general, Ma Dai, for alleged treason.

## Early life

Wei Yan was from Yiyang Commandery (義陽郡), which covered parts of present-day Nanyang in southern Henan and parts of northern Hubei. He started his career as a foot soldier under the warlord Liu Bei, probably sometime between 209 and 211 when Liu Bei was in southern Jing Province (covering present-day Hubei and Hunan). Around 212, he followed Liu Bei into Yi Province (covering present-day Sichuan and Chongqing) and served Liu Bei as a personal retainer in a war against Liu Zhang, the Governor of Yi Province (益州牧). Huang Zhong and Wei Yan scored many military exploits during the capture of Guanghan County. Thus, Wei Yan promoted to full general.
The campaign met early success with the quick death of Gao Pei and Yang Huai and the later occupation of the passes, followed by the defeat of Liu Zhang's reinforcements at Fu County. Pang Tong was killed during the siege of Luocheng and the siege became a prolonged one. One year later, Wei Yan and Liu Bei finally captured Luocheng, then surrounded and occupied Chengdu together with Zhuge Liang, Zhang Fei along with others. Thus, around the summer of 214, Liu Bei seized control of Yi Province from Liu Zhang. As Wei Yan has made several contributions in the conquest of Yi Province, Liu Bei promoted him to the rank of General of the Ivory Gate (牙門將軍).

## Administrator of Hanzhong

In 217, Liu Bei started the Hanzhong Campaign against his rival Cao Cao. There is no direct mention of Wei Yan's participation. After Liu Bei captured Hanzhong, Liu Bei asked his subjects to nominate one of his generals to remain behind and guard Hanzhong. His subjects nominated Zhang Fei, who also strongly believed that he would most likely be chosen. However, much to everyone's surprise, Liu Bei chose Wei Yan instead and appointed him as General Who Guards Distant Lands (鎮遠將軍) and acting Administrator of Hanzhong (漢中太守). When Liu Bei asked Wei Yan in front of everyone how would he perform his duty, the latter confidently replied:
   "If Cao Cao leads all his forces to attack Hanzhong, let me assist Your Highness in resisting them. If an enemy general comes with an army of 100,000, let me engulf them for Your Highness."
Liu Bei was very pleased and everyone was impressed with Wei Yan's reply.
During his tenure, Wei Yan explained to Liu Bei that he used a strategy called the "double gates" (重門之計). The ancient text I Ching described this strategy as a particularly designed fortification which laid numerous military garrisons surrounding the outskirt and trail exits linking to Hanzhong.
Following the end of the Eastern Han dynasty and the start of the Three Kingdoms period in 220, Liu Bei declared himself emperor in 221 and established the state of Shu Han (or Shu) to challenge the legitimacy of the Cao Wei (or Wei) state established by Cao Cao's successor, Cao Pi, to replace the Eastern Han dynasty. Liu Bei further promoted Wei Yan to General Who Guards the North (鎮北將軍) after his coronation.

## Northern Expeditions

After Liu Bei died in 223, his son Liu Shan succeeded him as the emperor of Shu. In the same year, Liu Shan enfeoffed Wei Yan as a Marquis of a Chief Village (都亭侯).
In 227, Zhuge Liang, the Imperial Chancellor of Shu, mobilised the Shu military and gathered troops in Hanzhong Commandery in preparation for a large scale invasion of Shu's rival state, Cao Wei (or Wei), where he put Wei Yan in charge of the vanguard division and appointed him as acting Major under the Imperial Chancellor (丞相司馬) and acting Inspector of Liang Province (涼州刺史). During this campaign, Wei Yan always requested to lead a separate detachment of 10,000 troops, take a different route through the Ziwu Valley (子午谷) and rendezvous with the Shu main army at Tong Pass (潼關; in present-day Tongguan County, Shaanxi).
Wei Yan argued that the Ziwu Valley and its resources could support the Shu army's operations at least for a week. However, Zhuge Liang rejected the plan because he thought that it was too risky, prompting Wei Yan to call Zhuge Liang a coward and complain that his talent was not put to good use. When Chen Shou compiled the unofficial works on the history of Shu to write the Sanguozhi, he only mentioned that Wei Yan suggested to Zhuge Liang to split the Shu army into two, and the two forces would take two different routes and rendezvous at Tong Pass.
Later in 230, during the Ziwu Campaign, Wei Yan led some troops towards Yangxi (陽谿; southwest of present-day Wushan County, Gansu) and engaged the Wei forces led by and Guo Huai and Fei Yao, where Wei Yan managed to inflict a heavy defeat to them. During the same year, he also assisted another Shu general Wu Yi in attacking Nan'an Commandery (南安郡; southeast of present-day Longxi County, Gansu) where they scored another victory against a Wei army led by Fei Yao.
During the fourth campaign in 231, Wei Yan was also involved in the Battle of Mount Qi when he, together with the Shu generals Gao Xiang and Wu Ban, scored a major victory against the Wei army led by Sima Yi, during which they killed 3,000 Wei soldiers and seized 5,000 sets of armour and 3,100 crossbows. Sima Yi was forced to retreat back to his camp. Zhang He, a veteran Wei general, was also killed in battle during this conflict. As a reward for his contributions, the Shu government promoted Wei Yan to Vanguard Military Adviser (前軍師) and Senior General Who Attacks the West (征西大將軍), and elevated him from a village marquis to a county marquis under the title "Marquis of Nanzheng" (南鄭侯).

## Battle of Wuzhang Plains

In 234, Zhuge Liang launched the fifth Shu invasion of Wei, with Wei Yan leading the Shu vanguard force as one of the commanding officers. Wei Yan reportedly had a dream that a horn grew on top of his head. He asked the dream diviner Zhao Zhi (趙直) the meaning of this. Zhao Zhi lied to him and said:
   "A qilin has horns, but does not use them; this is an auspicious sign that the enemy will destroy themselves without battle".
After Wei Yan left, Zhao Zhi revealed to someone that the Chinese character for "horn" (角) is composed of a "knife" (刀) with "use" (用) below it, which meant that dreaming of "using a knife" atop one's head was an extremely ominous omen. Later in the encampment, Wei Yan had a quarrel with Yang Yi, Zhuge Liang's chief clerk, whom Wei Yan was extremely resentful of. Whenever they got into heated quarrels, Wei Yan often drew his sword and brandished it in front of Yang Yi, who sobbed as tears rolled down his cheeks. This prompted Fei Yi to step in to stop them from fighting and keep them under control until Zhuge Liang's death. Zhuge Liang was upset by the lack of harmony between Wei Yan and Yang Yi, but was unwilling to side with either of them because he appreciated the talents of both men.
When Zhuge Liang became critically ill during the invasion, he gave secret orders to Yang Yi, Fei Yi and Jiang Wei to lead the army back to Shu after his death, with Wei Yan in charge of the rearguard and Jiang Wei to follow behind. If Wei Yan refused to follow the order, they were to retreat without him. When Zhuge Liang died, news of his death was kept secret. Yang Yi sent Fei Yi to meet Wei Yan and assess his intentions. Wei Yan told Fei Yi:
   "Although the Imperial Chancellor is dead, I am still alive. The officials serving in the Imperial Chancellor's Office may bring his body back (to Chengdu) for burial, but I should remain behind to lead the army to attack the enemy. Must we abandon our mission just because of the death of one man? Besides, who am I, Wei Yan, to submit to Yang Yi's command and lead the rearguard?"
Wei Yan then asked Fei Yi to assist him in making arrangements for part of the Shu army to remain behind and continue with the campaign, while the rest would retreat back to Shu. Fei Yi pretended to write a letter, signed by both of them, and told Wei Yan that he would read out the letter to all the officers about the new arrangements. It turned out that he had lied by telling Wei Yan that he would go back and explain Wei Yan's answer to Yang Yi.

## Death

Wei Yan then let Fei Yi leave, but he immediately regretted his decision and went after Fei Yi, but could not catch up with Fei Yi in time. He then sent his subordinate to meet Yang Yi and the others, but was shocked to discover that all units were preparing to retreat in accordance with Zhuge Liang's final orders. Wei Yan wanted to continue the battle even though Zhuge Liang had died, so he became furious when he heard of the retreat. He intended to block the Shu forces from retreating, so he led his force towards the south – ahead of the main army under Yang Yi's command – and sealed the return route by destroying the gallery roads leading back to Shu.
Wei Yan and Yang Yi separately wrote memorials to the Shu imperial court to accuse each other of treason; both memorials arrived in Chengdu on the same day. The Shu emperor Liu Shan asked the ministers Dong Yun and Jiang Wan for their opinions. Both of them sided with Yang Yi and felt that Wei Yan's actions were suspicious. In the meantime, Yang Yi ordered his men to cut down trees to rebuild the gallery roads, and his troops marched day and night to catch up with Wei Yan. Wei Yan arrived at the southern valley first and ordered his soldiers to attack Yang Yi. Yang Yi sent Wang Ping to resist Wei Yan. Wang Ping shouted at Wei Yan:
   "His Excellency (Zhuge Liang) had just died and his body had yet to turn cold, and now you dare to do something like this!"
Wei Yan's men knew that their commander was in the wrong so they deserted.
Wei Yan was left with only his son(s) and a few followers, and they fled towards Hanzhong Commandery. Yang Yi ordered Ma Dai to give chase. Ma Dai executed Wei Yan, brought his head back, and threw it in front of Yang Yi. Yang Yi trampled on Wei Yan's head and said:
   "You inferior slave! Now, can you still commit evil?"
Wei Yan's family members and close relatives were also executed. Before Wei Yan's death, Jiang Wan had led the imperial guards from Chengdu to deal with what appeared to be a mutiny by Wei Yan. They had travelled for about 10 li (about three miles) when they received news of Wei Yan's death; they then turned back and returned to Chengdu.

## Character analysis

Wei Yan was known for treating his soldiers well and for his bravery with valour that surpassed others. However, he was also boastful of his talents, hence his peers tended to shun him. Sun Quan had also once remarked that once Zhuge Liang died, Wei Yan would prove to be an unreliable person. Chen Shou, who wrote Wei Yan's biography in the Sanguozhi, analysed Wei Yan's death as such:
   "Wei Yan's initial intention was not to head north to surrender to Wei. Instead, he wanted to retreat back to the south. He desired to kill Yang Yi and the others who disagreed with him. Although the officers held differing opinions, he strongly believed that they would generally agree to him becoming Zhuge Liang's successor. That was his true intention; he was not thinking of rebelling."
Chen Shou also remarked that Zhuge Liang valued Wei Yan's bravery and was caught in a dilemma when the latter got into conflict with Yang Yi, whose talent Zhuge Liang also appreciated.
A similar, but somewhat different and more detailed, account exists in the historical text Weilüe by Yu Huan. It stated that Zhuge Liang told Wei Yan to set up defences, although he also gave further instruction to "not return here". Wei Yan kept this order to himself and did not share it with others, thus prompting Wei Yan's rival, Yang Yi, to spread false rumours that Wei Yan intended to defect to the enemy, causing Shu forces to turn against Wei Yan and result in his downfall. Pei Songzhi, who added the Weilüe account to Wei Yan's biography and annotated the Sanguozhi, cast doubts on the Weilüe account:
   "I believe this account (Weilue) was derived from hearsay in the enemy state (Wei) and may not be as reliable as compared to the original account (by Chen Shou)."
Wei Yan's death was explained in political terms in "Injustice to Wei Yan" (魏延的千古奇冤), a neoteric article by Zhu Ziyan, a history professor from Shanghai University. Zhu wrote that Zhuge Liang personally appointed Jiang Wan, Fei Yi and Jiang Wei to be his successors, but Wei Yan's appointments and contributions were greater than those of any of them at the time. Zhuge Liang ostracised Wei Yan and cracked down on him because he wanted to eliminate Wei Yan as a possible obstacle to his appointed successors.
Meanwhile, in the Analysis of the Three Kingdoms, Yi Zhongtian commented that Zhuge Liang's last order to forcibly retreat and leave Wei Yan alone was contradicted by what he personally instructed Wei Yan; such contradiction indirectly led to tragedy between Wei Yan and Yang Yi. The forced retreat after Zhuge Liang's death might have been Yang Yi's idea rather than Zhuge Liang's, since Zhuge Liang died before devising any withdrawal plan. Yi Zhongtian thus theorised that there was no evidence of the theory that Yang Yi fabricated the order. Yi Zhongtian also explained another possible hypothesis that Zhuge Liang's final order "leave Wei Yan alone" simply meant "ignore Wei Yan" rather than "kill Wei Yan"; the Shu forces had to withdraw and if Wei Yan could not be stopped, they should have just let him be. Yi Zhongtian analysed and criticised Wei Yan for not grasping the political-economic reasons behind Zhuge Liang's expeditions and his extreme caution. Zhuge Liang launched the expeditions not only to restore the Han dynasty, but also to keep Shu in a state of war so that he could strengthen his control over Shu's internal affairs and suppress potential dissidence among local elites in Shu.
As the smallest and weakest amongst the Three Kingdoms, Shu would be the first one to be targeted, hence it had to launch preemptive attacks to intimidate its opponents, to expand its territory, and to improve its conditions - the chances of success were not high but it would have been better than doing nothing. Zhuge Liang's goal of restoring the Han dynasty was sincere and had never changed. However, Wei was too powerful and could not be defeated in a single blow, hence the expeditions had to be carried out in a careful manner with guaranteed advances rather than going with daring but risky strikes which could lead to disasters like the Battles of Xiaoting and Fancheng. Such a complicated situation could not be explained clearly to Wei Yan, and probably did not need to be, as Zhuge Liang wanted to keep Wei Yan's morale at his peak.

## Ziwu Valley plan analysis

Wei Yan's reasoning for his Ziwu Valley Plan was recorded in the Weilüe, which was then added as an annotation to his biography in the Sanguozhi, where Chen Shou recorded that Wei Yan received intelligence which led him to conclude that the defender of the strategic city of Chang'an, Xiahou Mao, was incompetent. Thus, Wei Yan reasoned, it would be easy for him to take 5,000 troops (and another 5,000 to carry supplies) across the Qin Mountains via the Ziwu Valley and into Chang'an. Wei Yan estimated that he would reach Chang'an in ten days and scare Xiahou Mao into flight, leaving the grain in Chang'an's storehouses for Shu's taking. There, Wei Yan's force can wait for Zhuge Liang's main army to take the safer road out of Xie Valley (斜谷) and rendezvous in Chang'an. In this way, the region west of Xianyang could be conquered in one movement." The Weilue argued that the plan might have worked; Sima Yi had acknowledged the possibility that Shu forces would carry out the plan while Xiahou Mao had not realised it.
When the Wei government received intelligence about Wei Yan's Ziwu Valley Plan, the Wei emperor Cao Rui immediately removed Xiahou Mao from his military command in Chang'an and reassigned him to be a Master of Writing (尚書) in Luoyang. Yi Zhongtian, in his Analysis of the Three Kingdoms, commented that both proponents and opponents of Wei Yan's plan had strong reasons. Wei forces were rather unprepared to counter the first Northern Expedition as they had not foreseen that Shu forces could launch such an offensive, hence both Zhuge Liang and Wei Yan's strikes could have dealt a massive blow to Wei defences. However, Wei Yan's plan was also very risky, as neither Xiahou Mao's retreat nor the timely arrival of the main Shu force led by Zhuge Liang could have been guaranteed. Moreover, the Wei general Guo Huai was stationed nearby and could have come to Xiahou Mao's aid.
However, recent scholarship of Chinese history criticised the Weilue account, stating that Yu Huan had exaggerated the alleged conflict between Wei Yan and Zhuge Liang over the latter's rejection of the former's Ziwu Valley plan. Wen-Chin Wang of the Department of Chinese Language and Literature suspected that the Weilue account was biased since Yu Huan supported the state of Wei.

## Legacy
### Military fortification

The "Heavy Gate" (重門之計) bulwark designed by Wei Yan during his tenure as Administrator of Hanzhong Commandery particularly turned out useful on two occasions when his successors as Administrator of Hanzhong Commandery used it to repel invaders. It also helped the Shu general Wang Ping defend Hanzhong Commandery from a massive invasion led by the Wei general Cao Shuang. The Shu general Jiang Wei later dismantled the "Heavy Gate" fortification in favour of his own design. However, Jiang Wei's new defence strategy failed to impede Wei invaders led by Zhong Hui, and Jiang Wei himself ultimately lost control of Hanzhong.

### Wei Yan Shrines

A Wei Yan Shrine (魏延祠) is located in Baique Village, Sanquan Township, Zitong County, Sichuan. In front of the shrine flows a Wei Family River (魏家河). On the plains east of the river, there once stood a Wei Family River Temple (魏家河廟), which had three stone tablets in front of it. One of the stone tablets bears the words "Wei Yan once led soldiers and was stationed here." According to legend, in 231, during the fourth Shu invasion of Wei, Zhuge Liang ordered Wei Yan to lead a separate force to station south of the Wei Family River where, in memory of the incident, the locals built the Wei Family River Temple beside the river and a small bridge called "General Bridge" (將軍橋). The Wei Yan Shrine was initially demolished by the government but was rebuilt in 1995. A statue of Wei Yan stands in the main hall of the shrine.
There is another temple attributed to Wei Yan in Wei Yan's purported hometown in Weijia Village, Gaobao Township, Qingfeng County, Henan.

## In popular cultures
### In Romance of the Three Kingdoms

Wei Yan appears as a character in the historical novel Romance of the Three Kingdoms by Luo Guanzhong, which romanticises the historical events leading to, and during the Three Kingdoms period, such as Wei Yan participation in the fictional Battle of Changsha. Wei Yan surrendered to Liu Bei after killing his superior, Han Xuan.
During a clash between Liu Bei against Ma Chao forces, Wei Yan defeat Ma Dai after they duelled for several bouts, causing the latter to flee.
During the battle in Hanzhong, Wei Yan and Zhang Fei were unable to overcame Zhang He, causing both to retreat.
According to Zhang Chaoju, Wei Yan was beaten during this campaign by Cao Cao's general, Pang De.
Later, during the battle of Wuzhang plains, Wei Yan lured Sima Yi and his two sons, Sima Shi and Sima Zhao into a fire ambush. However, a sudden, heavy rain caused the fire to extinguish, and the plan failed; prompting the Simas to escape.

### Modern era depictions

“Sun Qi Mountain” drama which was written by Wei Ming-Lun, that described the relationship between two important historical figures Zhuge Liang and Wei Yan depicted the latter in positive light as it was not Wei Yan intent to betray Shu, which making him as tragic hero figure.
Wei Yan is featured as a playable character in Koei's Dynasty Warriors and Warriors Orochi video game series. He also appears in Koei's Dynasty Tactics 2.