Li Yan 李嚴 (d. 234), courtesy name Zhengfang 正方, was a military commander of the state of Shu-Han 蜀漢 (221-263), one of the Three Empires 三國 (220~280 CE).
He hailed from Nanyang 南陽 (today's province of Henan) and served the warlord Liu Zhang 劉璋 (d. 219) as magistrate (ling 令) of the city of Chengdu 成都. In 213, he took over a military command and defected to Liu Bei 劉備 (161-222), who made him assistant general (pi jiangjun 裨將軍), and later governor (taishou 太守) of the commandery of Jianwei 犍為. For his military achievements against the rebels in Qixian 郪縣 (around Zhongjiang 中江, Sichuan), Li Yan obtained the title of General of Revived Glory (xingye jiangjun 興業將軍). Li put down the rebellion of the chieftains Ma Qin 馬秦 and Gao Sheng 高勝 and was bestowed the title of Bulwark-General of the Han (fu Han jiangjun 輔漢將軍) and given the honorific post of Director of the Imperial Secretariat (shangshu ling 尚書令).
When Liu Bei passed away, Li Yan was entrusted with the command over the central army (zhong duhu 中都護), which protected the capital and Emperor Liu Shan 劉禪 (r. 223-263 CE). The position yielded him the rank of Township Marquis of Duxiang 都鄉侯. Li resided in Yong'an 永安. He climbed the ladder of honours with the title of General of the Front Army (qian jiangjun 前將軍) and cavalry general (piaoji jiangjun 驃騎將軍). He also bore the honorific title of Chamberlain for Attendants (guangluxun 光祿勛). In order to express his loyalty to the dynasty, Li Yan changed his personal name to Li Ping 李平. In 231, however, he fell from grace for his negligence of logistics in chief minister Zhuge Liang's 諸葛亮 (181-234) northern campaign and was dismissed and demoted to the status of a commoner. He died shortly after Zhuge Liang passed away.