During the reign of Emperor Tianzuo, the Jurchen tribes led by Wanyan Aguda established the Jin dynasty in 1115.
Emperor Tianzuo, however, proved incompetent in dealing with the Jin threat, and in 1115 a coup was attempted by Liao generals to install his uncle Yelü Chun to the throne but was thwarted.
After the end of the Northern Liao dynasty, the general Yelü Dashi rejoined Emperor Tianzuo.
In 1124, Yelü Dashi fled to the west with a band of his followers, and established the Western Liao dynasty.
Yelü Yanxi was more familiar with horse riding, and tried to escape, but was shot to death by Jurchen archers.