Liu Yan (Chinese: 劉晏; c. 715/716 – August 12, 780), courtesy name Shi'an (士安), was an official of the Chinese Tang dynasty who served briefly as chancellor during the reign of Emperor Daizong — but who was more known for his reforms in the Tang salt monopoly and food transportation systems, credited with allowing the Tang economy to recover after the disastrous An Lushan Rebellion. In 780, during the reign of Emperor Daizong's son Emperor Dezong, after the chancellor Yang Yan made a series of false accusations against him, he was first demoted and then executed.
Liu Yan was born in 715 or 716. His family was from Cao Prefecture (曹州, in modern Heze, Shandong), and traced its ancestry to Liu Jiao (劉交), a younger brother of Han Dynasty's founder Emperor Gao. His great-great-grandfather Liu Jin (劉晉) served as a county magistrate during Tang Dynasty's predecessor Sui Dynasty, and his great-grandfather Liu Yu (劉郁) served as an imperial scholar early in Tang. His grandfather Liu Gong (劉功) served as a county magistrate, while his father Liu Zhihui (劉知晦) served as a county secretary general.
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.