According to the popular folk tale, the Jade Emperor was originally a mortal by the name of Zhang Denglai. He is said to have been a minor functionary or common soldier who lived around the end of the Shang Dynasty and the beginning of the Zhou Dynasty . Zhang Denglai was one of the many people who died during the civil war that resulted in the toppling of the Shang Dynasty. As he fought for the Zhou Dynasty, Zhang Denglai was posthumously rewarded. These rewards were being distributed by Jiang Ziya, a noble who was instrumental in overthrowing the Shang Dynasty. One by one, the highest positions in the heavenly hierarchy were filled, until only the office of the Jade Emperor was left.