Cui Yin (崔胤) (854New Book of Tang, vol. 223, part 2. – February 1, 904Zizhi Tongjian, vol. 264.Academia Sinica Chinese-Western Calendar Converter.), courtesy name Chuixiu (垂休),The courtesy name of Chuixiu is from Cui's biography in the New Book of Tang; his biography in the Old Book of Tang gave his courtesy name as Changxia (昌遐), but appeared to have confused him with his older brother, whose name was Changxia according to the table of the chancellors' family trees in the New Book of Tang. Compare Old Book of Tang, vol. 177 with New Book of Tang, vol. 72.. nickname Zilang (緇郎), formally the Duke of Wei (魏公), was an official of the Chinese Tang dynasty, serving as a chancellor during the reign of Emperor Zhaozong. He was a controversial figure in the late Tang period, who ruthlessly tried to destroy the powerful eunuchs at court and whose actions in that regard had traditionally made him regarded as one of the persons causing the demise of the dynasty at the hands of the warlord Zhu Quanzhong the military governor of Xuanwu Circuit (宣武, headquartered in modern Kaifeng, Henan) (who would overthrow Tang and establish his own Later Liang).

Background Cui Yin was born in 854, during the reign of Emperor Xuānzong. He was from the prominent Cui clan of Qinghe (清河, in modern Xingtai, Hebei), specifically from the "Wushui branch " of that clan. Cui Yin's father Cui Shenyou was a chancellor during Emperor Xuānzong's reign. Cui Yin had at least one older brother, Cui Changxia ().New Book of Tang, vol. 72. (According to the biography of the powerful eunuch Qiu Shiliang in the New Book of Tang, Cui Yin developed a hatred for eunuchs early in his life due to Cui Shenyou's relating to him of an incident during the earlier reign of Emperor Xuānzong's nephew Emperor Wenzong, when Qiu tried to have Emperor Wenzong deposed.)New Book of Tang, vol. 207.

Early career After Cui Yin passed the imperial examinations in the Jinshi () class,Cui Yin's biography in the Old Book of Tang gave the date of his passage of the imperial examinations as the second year of Emperor Zhaozong's Qianning era (895), which was clearly an error, and could have been referring to the second year of Emperor Yizong's Xianning era (861), or, given the error with confusing Cui Yin with his brother Cui Changxia, could have been referring to Cui Changxia's passing the imperial examinations in 895, although that would also appear to be unlikely. The New Book of Tang gave no date for his passage of the imperial examinations. he served on the staff of Wang Chongrong the military governor of Hezhong Circuit (河中, headquartered in modern Yuncheng, Shanxi).Old Book of Tang, vol. 177. (Wang was military governor of Hezhong from 881 to Wang's death in 887, placing a timeframe on Cui's service under him.)Old Book of Tang, vol. 182. Later, after Cui was recalled to the imperial government, he served successively as Kaogong Yuanwailang () and then Libu Yuanwailang (), both low-level positions at the ministry of civil service affairs (吏部, Libu). He was later promoted to a supervisory position at the ministry of civil service affairs (郎中, Langzhong). He was later made imperial attendant (給事中, Jishizhong) and then Zhongshu Sheren (), a mid-level official at the legislative bureau of government (中書省, Zhongshu Sheng). During the Dashun era of Emperor Xuānzong's grandson Emperor Zhaozong (890–891), Cui successively served as deputy minister of defense (兵部侍郎, Bingbu Shilang) then deputy minister of civil service affairs (吏部侍郎, Libu Shilang). (It was said that his repeated promotions were a result of his close association with the chancellor Cui Zhaowei, who, while not a close relative, regarded him as a clansman.)

First three terms as chancellor Thanks to his association with Cui Zhaowei, Cui Yin was promoted to be chancellor in 893 with the designation Tong Zhongshu Menxia Pingzhangshi (). As chancellor, he was described to be treacherous in his heart but appearing to be forgiving in his outward appearance. (It was also said that his uncle, the major general Cui Anqian, commented, "My father and brother had carefully built this household, but Zilang [(i.e., Cui Yin)] will destroy it!" although it was unclear whether Cui Anqian was still alive at this point.)Zizhi Tongjian, vol. 259.

In 895, when Wang Chongrong's brother and successor Wang Chongying died at Hezhong (which had been renamed Huguo at this point), the soldiers supported Wang Chongrong's adoptive son and biological nephew Wang Ke to succeed him as the military governor, but Wang Chongying's son Wang Gong, then the military governor of neighboring Baoyi Circuit (保義, headquartered in modern Sanmenxia, Henan), also had designs on Huguo. Wang Ke was supported by his father-in-law Li Keyong the military governor of Hedong Circuit (河東, headquartered in modern Taiyuan, Shanxi), while Wang Gong was supported by his allies Li Maozhen the military governor of Fengxiang Circuit (鳳翔, headquartered in modern Baoji, Shaanxi), Wang Xingyu the military governor of Jingnan Circuit (靜難, headquartered in modern Xianyang, Shaanxi), and Han Jian the military governor of Zhenguo Circuit (鎮國, headquartered in modern Weinan, Shaanxi), and all these military governors submitted competing petitions to Emperor Zhaozong in support of Wang Ke or Wang Gong. Emperor Zhaozong initially approved Li Keyong's request and made Wang Ke the military governor of Huguo but, subsequently, trying to settle the dispute, named Cui the military governor of Huguo, still carrying the Tong Zhongshu Menxia Pingzhangshi designation as an honorary title. Wang Tuan was made a chancellor to replace him.Zizhi Tongjian, vol. 260.

This failed to settle the dispute, however, and, at Cui Zhaowei's instigation (as Cui Zhaowei was allied with Li Maozhen and Wang Xingyu), the three military governors who supported Wang Gong marched on the imperial capital Chang'an, killing the chancellors Li Xi and Wei Zhaodu and forcing Emperor Zhaozong to accede to their demands. That, in turn, caused Li Keyong to launch his troops to attack them. Emperor Zhaozong, fearing that Li Maozhen and/or Wang Xingyu would seize him, fled into the Qinling Mountains. Cui Yin, along with chancellors Xu Yanruo and Wang Tuan, followed the emperor in flight. After Li Keyong defeated Wang Xingyu, who was then killed by his own subordinates, Li Maozhen and Han outwardly submitted to the emperor, and Emperor Zhaozong, after returning to Chang'an, ordered Li Keyong to end his campaign. Meanwhile, Cui was again made a chancellor, and also took the position of Zhongshu Shilang (), the deputy head of the legislative bureau. However, his ally, Cui Zhaowei, was exiled and then executed.

In 896, the fragile peace between the imperial government and Li Maozhen ended, and Li Maozhen again postured to attack Chang'an. Emperor Zhaozong and the imperial court initially decided to flee to Hedong, but due to the long distance involved and the urging of Han's, decided to head for Han's capital Hua Prefecture () instead. Once the imperial court settled in at Hua Prefecture, however, Han inserted himself in all kinds of decision-making, and as one of his suggestions, Emperor Zhaozong, who was aware of the alliance between Cui Zhaowei and Cui Yin, decided to send Cui Yin away to serve as the military governor of Wu'an Circuit (武安, headquartered in modern Changsha, Hunan), still carrying the Tong Zhongshu Menxia Pingzhangshi designation as an honorary title; Cui was replaced with Lu Yi. Cui, however, secretly sought aid from Zhu Quanzhong the military governor of Xuanwu Circuit (宣武, headquartered in modern Kaifeng, Henan)—and suggested to Zhu that he could posture by preparing the palace at the eastern capital Luoyang and petitioning Emperor Zhaozong to move the capital to Luoyang. Zhu did so (along with his ally Zhang Quanyi the mayor of Henan Municipality (河南, i.e., the Luoyang region)) and also mobilized his troops; his petition also indicated his belief that Cui, as a faithful servant to the emperor, should not be sent away. Han, in fear of a potential Zhu attack, backed off, and Emperor Zhaozong subsequently kept Cui at court and made him a chancellor again, along with Cui Yuan. Cui Yin, displeased that Lu had replaced him, then falsely accused Lu of being an ally of Li Maozhen's; Lu was then exiled to the post of prefect of Xia Prefecture (硤州, in modern Yichang, Hubei).

Cui continued to serve as chancellor until 899, by which time Emperor Zhaozong had returned to Chang'an; Cui assumed just his regular posts of Zhongshu Shilang and minister of civil service affairs (吏部尚書, Libu Shangshu); Lu, who had been recalled by this point and was serving as the minister of defense (兵部尚書, Bingbu Shangshu), replaced him.Zizhi Tongjian, vol. 261. (During this 896–899 term as chancellor, it was said that Cui secretly plotted with the emperor to slaughter the eunuchs. Wang Tuan, fearing the repercussions of such a plot, urged moderation, pointing out that a major confrontation between imperial officials and eunuchs would have uncertain results. When Cui was removed from the chancellor position in 899, he thus suspected Wang of being behind his removal and hated Wang from this point on; he also accused Wang of being in league with the powerful eunuch directors of palace communications Zhu Daobi () and Jing Wuxiu ()Zizhi Tongjian, vol. 262.

Latter two terms as chancellor In 900, Cui Yin was sent out of the capital to serve as military governor of Qinghai Circuit (清海, headquartered in modern Guangzhou, Guangdong), carrying the Tong Zhongshu Menxia Pingzhangshi as an honorary designation. Cui, believing that Wang Tuan was trying to eliminate him as a rival, wrote Zhu Quanzhong to ask for aid. Zhu Quanzhong, in response, submitted multiple petitions accusing Wang of collaboration with Zhu Daobi and Jing Wuxiu and urging Emperor Zhaozong to keep Cui as a chancellor. As a result, Cui was recalled from his journey to Qinghai. Upon arrival in Chang'an, he was made chancellor again, as well as Sikong (司空, one of the Three Excellencies) and Menxia Shilang (), the deputy head of the examination bureau (門下省, Menxia Sheng). Wang was initially demoted to be the deputy minister of public works, while Zhu Daobi and Jing were sent out of the capital to serve as eunuch monitors; soon, all three were ordered to commit suicide. After this incident, Cui became, effectively, the most powerful official at court, and the eunuchs hated him. It was said that, because he was jealous of the more senior Xu Yanruo, that Xu decided to ask for the Qinghai assignment himself and was soon made the military governor of Qinghai.

The most powerful eunuchs—the commanders of the Shence Armies Liu Jishu and Wang Zhongxian () and the new directors of palace communications Wang Yanfan () and Xue Qiwo ()—fearing the next steps that Cui and Emperor Zhaozong—whose behavior had become increasingly erratic after his return from Zhenguo, apparently fueled by alcoholism—might take, began to plan a coup to overthrow the emperor and replace him with his son and crown prince Li Yi. In winter 900, after an incident where Emperor Zhaozong killed a few eunuchs and ladies in waiting in a drunken rage, the eunuchs acted. They mobilized the Shence Armies and forced the imperial officials, including Cui (who did not dare to oppose them given their military strength) to sign a petition urging Emperor Zhaozong to yield imperial power to Li Yu. Armed with the petition, the eunuchs then removed the emperor and put him under house arrest, declaring Li Yu emperor instead. Liu killed a number of officials, eunuchs, ladies in waiting, and other people that Emperor Zhaozong favored, but hesitated at killing Cui, fearing that Cui's ally Zhu Quanzhong, whose support for the coup he was trying to court, would react violently. Rather, they only removed Cui from one of his secondary offices, the directorate of salt and iron monopolies.