The Yan Emperor (Chinese: 炎帝; pinyin: Yán Dì) or the Flame Emperor was a legendary ancient Chinese ruler in pre-dynastic times. Modern scholarship has identified the Sheep's Head Mountains (Yángtóu Shān) just north of Baoji in Shaanxi Province as his homeland and territory.[1]

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.[2] 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.[3]

No written records are known to exist from the era of Yan Emperor's reign. However, he and Shennong are mentioned in many of the classic works of ancient China. Yan literally means "flame", implying that Yan Emperor's people possibly uphold a symbol of fire as their tribal totems. K. C. Wu speculates that this appellation may be connected with the use of fire to clear the fields in slash and burn agriculture.[4] In any case, it appears that agricultural innovations by Shennong and his descendants contributed to some sort of socioeconomic success that lead them to style themselves as di (Chinese: 帝; literally: "emperors"), rather than hou (Chinese: 侯; literally: "lord"), as in the case of lesser tribal leaders. At this time it appears that there were only the bare beginnings of written language, and that for record keeping a system of knotting strings (perhaps similar to quipu) was in use.[5] The Zuo Zhuan states that in 525 BC, the descendants of Yan were recognized as long having been masters of fire and having used fire in their names.[6] Yan Emperor was known as "Emperor of the South"[7]

The Yan Emperor, retreating from a recent invasion from the forces of Chi You, came into territorial conflict with its neighbouring Youxiong tribes, led by the Yellow Emperor. The Yan Emperor was defeated after three successive battles and surrendered to the Yellow Emperor, who assumed the title of overlord (Chinese: 共主) and agreed to merge the two tribes into a new confederation — the Yanhuang tribe. Under the Yellow Emperor's leadership, the newly combined tribes then went to war and defeated Chi You in the Battle of Zhuolu, and established their cultural and political dominance in China proper.

Since the Battle of Banquan is treated as a historical fact by Sima Qian in his Records of the Grand Historian, it would appear that this is a pivotal transition point between mythology and history. Ironically, Yan Emperor enters history only with his submission to the will of the Yellow Emperor. In any case, the title of flame emperor apparently lapsed after this time, while his tribe's descendants were said to be perpetuated through intermarriage with that of the Yellow Emperor, and Han Chinese throughout history have referred themselves as the "Descendants of Yan and Huang".

Both Huangdi and Yandi are considered in some sense ancestral to Chinese culture and people. Also, the tradition of associating a certain color with a particular dynasty may have begun with the Flame Emperors. According to the Five Elements, or Wu Xing model, red, fire, should be succeeded by yellow, earth—or Yandi by Huangdi.[8]