and made the commander of the Chang'an police. Soon thereafter, he was made the mayor of Jingzhao Municipality (京兆, i.e., the Chang'an region). That year, there was a serious drought in the region. Cui requested that the Chan River (滻水) waters that usually were directed into the palace be reduced by 90%, so that the water could be used to water the people's fields, and Emperor Wenzong agreed. In 838, when an assassination attempt was made against the chancellor Li Shi (traditionally believed to be engineered by the powerful eunuch Qiu Shiliang), Cui, who was unable to capture Li Shi's would-be assassins, was punished by being stripped of part of his salary. During Emperor Wuzong's reign Emperor Wenzong died in 840 and was succeeded by his brother Emperor Wuzong. At that time, Cui Gong was serving as the minister of justice (刑部尚書, Xingbu Shangshu), and soon after Emperor Wuzong's ascension was made a chancellor de facto with the title Tong Zhongshu Menxia Pingzhangshi (同中書門下平章事). He was also made the director of the salt and iron monopolies. When, in 841, Emperor Wuzong, believing the former chancellors Yang Sifu and Li Jue had opposed his succession and therefore wanted to force them to commit suicide, Cui, along with his fellow chancellors Li Deyu, Cui Dan, and Chen Yixing, interceded, and Yang and Li Jue were spared of their lives, although they were exiled. It was said that Cui Gong was friendly with Li Deyu, who was then, effectively, the leading chancellor. However, in 842, there was an occasion when Cui Gong recommended Liu Gongquan to be an imperial scholar at Jixian Institute (集賢院) and serve as its acting director. Li Deyu, displeased that this recommendation did not come from himself, found an excuse soon thereafter to have Liu demoted. Further, Cui Gong had a rivalry with another official, Cui Xuan. After Cui Gong was removed from his chancellor post in 843 and made You Pushe (右僕射, one of the heads of the executive bureau of government (尚書省, Shangshu Sheng), Cui Xian succeeded him as chancellor and the director of salt and iron monopolies, and accused him of having misused the salt and iron monopoly funds from Songzhou and Hua (滑州, in modern Anyang, Henan) Prefectures, as well as being protective of the warlord Liu Congjian. As a result, Cui Gong was exiled and demoted to be the prefect of Li Prefecture (澧州,