The Yan Emperor (Chinese: 炎帝; pinyin: Yán Dì) or the Flame Emperor was a legendary ancient Chinese ruler who ruled before the Yellow Emperor. Modern studies have identified the Sheep's Head Mountains (Yángtóu Shān) just north of Baoji in Shaanxi Province as his kingdom.
A long debate has existed over whether or not the Yan Emperor was the same person as the legendary Shennong. An academic conference held in China in 2004 achieved general consensus that the Yan Emperor and Shennong were the same person. Another possibility is that the term "flame emperor" was a title, held by dynastic succession of tribal lords, with Shennong being known as Yandi perhaps posthumously. Accordingly, the term "flame emperors" would be generally more correct. The succession of these flame emperors, from Shennong, the first Yan Emperor, until the time of the last Yan Emperor's defeat by the Yellow Emperor, may have been some 500 years.