When Emperor Xuanzong offered sacrifices at Mount Tai in 725, Liu Yan, then a child, wrote a song and submitted it to Emperor Xuanzong. Emperor Xuanzong was amazed, and he had his chancellor Zhang Shuo test Liu's knowledge. Zhang was also impressed and stated, This is a sign of fortune for the empire. He made Liu a scribe in the imperial government, at his young age, and Liu became referred to as the godly child. The honored men all rushed to invite him to their households.