In 793, Liu passed the jinshi imperial examination. One of the other successful candidates that year was another great poet, Liu Zongyuan, whose career was to be closely connected to that of Liu Yuxi. That same year, Liu Yuxi went on to pass the higher examination (boxue hongceke). In 795, the Ministry of Appointments sent him to be a tutor to the Heir Apparent, a sign that he was destined from a prominent career. However, in 796, his father suddenly died and he had to return to Yangzhou.