 He entered the civil service after achieving a "jinshi" degree in 695 during the reign of Empress Regnant Wu Zetian, and continued serving the court under three subsequent emperors Zhongzong, Ruizong, and Xuanzong, serving first in the Imperial Academy ("guozijian"), and then in the Ministry of Rites and Ministry of Works.Well regarded for his poetry and calligraphy, he is one of the Tang dynasty's Eight Immortals of the Wine Cup.Only a few of his works have survived.