structural:summarization, quality:corruption
Xingzong (1031–1055)

The 15 year old Yelü Zongzhen, posthumously Emperor Xingzong of Liao, was born to Emperor Shengzong of Liao and one of his lesser consorts, Xiao Noujin. Despite his parentage, he was raised as the adopted son of Empress Qitian (Xiao Pusage). Noujin fabricated a plot by Qitian to rebel and had her banished and then forced to commit suicide. Noujin declared herself the regent, made her birthday a public holiday, and began holding court and conducting duties normally within the purview of the emperor. In 1034, Noujin plotted to replace Xingzong with his younger brother, Zhongyuan, whom she had brought up herself. Zhongyuan wanted no part of this and informed Xingzong of their mother's plans, resulting in Noujin's banishment to their father's mausoleum. For his part in defeating the coup, Zhongyuan was given the title of "Imperial Younger Brother" and filled a succession of high ranking posts: commander in chief, northern commissioner of military affairs, and viceroy of the Southern Capital. Noujin's relatives remained in power at court. In 1037, Xingzong attempted to reconcile with these elements by treating Noujin with great respect and paying her visits. Xingzong appointed her brother, Xiao Xiaomu, as northern chancellor. In 1039, Noujin returned to the capital and underwent a rebirth ceremony to symbolically re-establish her position. The Song dynasty began sending separate envoys to pay respects to her.

Xingzong's reign saw the codification of law in 1036 with the promulgation of the Xinding tiaozhi which contained 547 articles and compiled all the laws since Abaoji 's reign. In 1046, all local administrators were ordered to report all legal cases to the Supreme Capital. The laws were further revised in 1051. The universal application of the law was opposed by the pro-Khitan faction of Zhongyuan. In 1043, Chinese living in the Southern Establishments were forbidden from owning bows and arrows. In 1044, at the suggestion of Zhongyuan, Khitan police inspectors were established in each of the capitals to protect Khitan interests. In 1046, Khitans were forbidden to sell slaves to Chinese. On the other hand, restrictions on the Balhae people relaxed and they were allowed to play polo, a game regarded as a military exercise.

Militarily, the Liao seemed to be in decline during Xingzong's reign. The number of wars conducted in previous decades had put a great burden on the people. In the late 1030s, Xingzong asked his ministers for advice on dealing with growing distress, impoverishment, internal discontent, and banditry due to excessive demands for corvée and military service. The Confucian scholar, Xiao Hanjianu, advocated for withdrawing overextended garrisons from far off frontiers and the cessation of expansionist policies that incorporated useless territory. Instead, these forces should be concentrated in key areas to the south and east. In 1039, a census was conducted to provide a basis for levying manpower. The army was short on horses so the sacrifice of horses and oxen in ceremonies was banned in 1043. The army and its dependencies were organized into registries in 1046 and these registries were further revised in 1051. There was also concern about the quality of the troops' training, especially the Chinese troops that specialized in artillery and crossbows, skills that augmented the Khitans' cavalry forces.

In 1042, the Khitans took advantage of the Li Yuanhao's invasion of Song to ask for territorial concessions from the Song. Negotiations resulted in the Liao dropping their territorial claims and an increase in annual tribute from the Song to 200,000 tales of silver and 300,000 bolts of silk. When Li Yuanhao asked the Khitans in 1043 to join him in attacking the Song, Xingzong refused. In 1044, some Tanguts living in Liao territory rebelled and sought refuge in Western Xia. The Khitans blamed Yuanhao for instigating the rebellion and immediately sent an invasion force led by Zhongyuan and the northern commissioner for military affairs Xiao Hui. Liao forces enjoyed an initial victory but failed to take the Xia capital and were brutally mauled by Yuanhao's defenders. According to Song spies, there was a succession of carts bearing Liao dead across the desert. In 1048, the Xia emperor died and the throne passed to an infant. The Khitans saw their opportunity for vengeance and invaded in a three pronged attack. The army under Xingzong's personal command encountered little resistance but had to withdraw owing to the lack of water and pasture for its horses. Xiao Hui's army advanced on the Yellow River with a flotilla of warships but was ambushed and defeated. The third army raided a Tangut palace in the Helan Mountains, capturing Yuanhao's young widow and some high-ranking officials. The Khitans invaded again the next year and plundered the Xia countryside and accepted the surrender of a Tangut general. The Western Xia agreed to become a tributary and peaceful relations were restored by 1053.

In 1044, Datong formally became the "Western Capital" (Xijing), completing the five capital regions.

Xingzong fell sick and died on 28 August 1055. He was 39 years old.