Li Wei (; died November 20, 879), courtesy name Maoxiu (), was an official of the Chinese Tang dynasty, serving as a chancellor during the reign of Emperor Xizong.
It is not known when Li Wei was born. He was from the Guzang Branch of the Li clan of Longxi, which, like the Tang dynasty's imperial clan, claimed ancestry from Li Gao, the founder of the Sixteen Kingdoms period state Western LiangâÂÂwith the Tang imperial clan descended from Li Gao's second son Li Xin (Western Liang's second duke) and Li Wei's ancestors descended from Li Gao's eighth son Li Fan () and Li Fan's son, the prominent Northern Wei general Li Bao (). Subsequent male-line ancestors of Li Wei's served as officials of Northern Wei, the Sui dynasty, and Tang. Li Wei's grandfather Li Shanggong () served as the director of the archival bureau (ç§ÂæÂ¸ç£, Mishu Jian), while his father Li Jingsu () served on the staff of a crown prince.
Li Wei himself passed the imperial examinations in the Jinshi class late in Emperor Wenzong's Kaifeng era (836âÂÂ840) and was made an assistant to the military governor (jiedushi) of Shannan East Circuit (å±±åÂÂæÂ±éÂÂ, headquartered in modern Xiangfan, Hubei). At some point thereafter, he apparently served as an assistant to the military governor of Hedong Circuit (æ²³æÂ±, headquartered in modern Taiyuan, Shanxi). Late in the Huichang era (841âÂÂ847) of Emperor Wenzong's brother and successor Emperor Wuzong, he passed a special imperial examination for those who made good rulings and was thereafter made an imperial censor with the title Jiancha Yushi (). He thereafter served as director of imperial palace affairs (殿ä¸Âç£, Dianzhong Jian). In 853, by which time Emperor Wuzong's uncle Emperor XuÃÂnzong was emperor, Li Wei became in charge of the affairs of the Office of Censors. Thereafter, he became in charge of drafting imperial edicts and was made Zhongshu Sheren (), a mid-level official at the legislative bureau of government (ä¸ÂæÂ¸çÂÂ, Zhongshu Sheng).
In 864, during the reign of Emperor XuÃÂnzong's son Emperor Yizong, Li Wei was put in charge of the imperial examinations for that year at the ministry of rites (禮é¨, Libu). In 865, he was made the deputy minister of rites (禮é¨ä¾ÂéÂÂ, Libu Shilang), and he was subsequently made Shangshu You Cheng (), one of the secretaries general of the executive bureau (å°ÂæÂ¸çÂÂ, Shangshu Sheng). As he considered Emperor Yizong overly devout in BuddhismâÂÂwith the emperor often holding grand feasts for large groups of Buddhist monks in the palaceâÂÂhe submitted a lengthy petition asking the emperor to curb his ways. Emperor Yizong praised him for the advice, but did not follow it. Li Wei later served as the mayor of Jingzhao Municipality (京å Â, i.e., the region of the capital Chang'an), and then the minister of worship (太常å¿, Taichang Qing). Yet later, he served as the military governor of Xuanwu Circuit (宣æÂ¦, headquartered in modern Kaifeng, Henan), then of Huainan Circuit (æ·®åÂÂ, headquartered in modern Yangzhou, Jiangsu). When his term as the military governor of Huainan was over, the people petitioned to have him remain as military governor, and Emperor Yizong agreed to a one-year extension.
At some point, Li Wei was recalled to Chang'an, and in 875, by which time he was chief imperial censor (御å²大夫, Yushi Daifu), he was made Zhongshu Shilang (), the deputy head of the legislative bureau, and given the designation Tong Zhongshu Menxia Pingzhangshi (), making him a chancellor de facto.
Little is known about Li Wei's acts as a chancellor. In 878, he was removed from his chancellor position and made the defender of the eastern capital Luoyang. In 879, after Cui Jikang () the military governor of Hedong was killed in a mutiny, and Cui's successor Li Kan () was not well liked by the soldiers, the imperial government decided that, because Li Wei had previously treated the people of Hedong well when he served there, to make him military governor. He arrived there late in 879 but died just three days after arrival.