During the Shengli era (697–701) of Emperor Gaozong's wife Wu Zetian, Liu passed the imperial examinations and made the sheriff of Langzhong County (閬中, in modern Bazhong, Sichuan).
For some time, the key officials in power were the coup leaders Zhang Jianzhi, Cui Xuanwei, Huan Yanfan, Jing Hui, and Yuan Shuji.
She viewed Emperor Zhongzong's brother Li Dan the Prince of Xiang and sister Princess Taiping as threats, and considered killing them.
They, along with Princess Taiping's son Xue Chongjian (薛崇簡), Zhong Shaojing, Wang Chongye (王崇曄), Liu, and Ma Sizong (麻嗣宗), planned a coup, and soon launched it, with support from imperial guard soldiers disgruntled at harsh treatment by their commanders Wei Bo (韋播) and Gao Song (高嵩), Empress Wei's nephews whom she had put in charge.
Later in the year, when he was referred to as the minister of civil service affairs (吏部尚書, Libu Shangshu), another major governmental reorganization saw him made Shizhong (侍中), the head of the examination bureau (門下省, Menxia Sheng), a post considered one for a chancellor.
In 712, after Li Jin (李璡) the prefect of Yan Prefecture (燕州, in modern Beijing) submitted a false report to Liu about Xue Na the commandant at You Prefecture (幽州, also in modern Beijing), under whom Li Jin was serving, Liu recommended that Xue be replaced by the general Sun Quan (孫佺).
Meanwhile, Princess Taiping continued to be highly much influential in governance of the governmental matters through Emperor Ruizong, and most chancellors were her associates.
Liu and the general Zhang Wei (張暐), with Emperor Xuanzong's approval, planned to mobilize the imperial guards to kill several of those chancellors—Dou Huaizhen, Cui Shi and Cen Xi.
In 713, after receiving a report that Princess Taiping and her partisans were planning to overthrow him, Emperor Xuanzong acted first, killing her associates and forcing her to commit suicide.
He recalled Liu from exile and made him Zuo Pushe (左僕射), also head of the executive bureau, and gave him the chancellor de facto designation of Pingzhang Junguo Dashi (平章軍國大事) and later again Tong Zhongshu Menxia Sanpin.
Late that year, Liu again became Shizhong, although he was soon removed from the chancellor position altogether when Zhang was replaced with Yao Chong.