Mongolia-Liao War

The Mongolia-Liao War was a four-year fought between the factions of the brothers Khan Liang Jing of Mongolia and King Liang Yan of Liang Liao from 943 to 947. The death of King Liang Yong in 943 led to his kingdom being divided between supporters of both of his sons, with Liang Jing inheriting the vast majority of his father's lands. He was forced to declare war on his younger brother in order to reunify the country, and, after several battles, he forced his brother to abdicate and thus reunited the country under his rule.

Background
In 940 AD, King Liang Yong of Liang Liao discovered that High Chief Naiman Chala was planning to fabricate a claim on his kingdom and launch a rebellion. Hoping to forestall this, he attempted to have Naiman arrested on 25 August 940, but he evaded capture and rose his flag in rebellion. Liang Yong personally took command of a mercenary army with the goal of putting down the uprising, defeating a large rebel army at Egiin on 24 December 940. Naiman Chala was slain by Liang Yong's officer Cha in that battle, but the rebellion continued. On 25 March 941, while continuing the fight against the rebels, Liang Yong discovered that his concubine Chaogui had given birth to his second son, Liang Jing, whom he ennobled as Chief of Egiin at just two days old. On 26 July 941, at the Battle of Uvs, Liang Yong challenged the enemy officer Gou'er to a duel, but Gou'er wounded him in the face with his spear. On 6 August, as the battle raged on, Liang Jing suffered another wound at the hands of Gou'er. He became rivals with Gou'er, whom he met in battle again at Abakan on 22 October 941. In this battle, Liang Yong succeeded in beheading Gou'er, settling an old score. However, as Liang Yong admired the battlefield, he was ambushed by enemy soldiers and badly maimed. The battle led to the capture of the rebel leader Tsambagaravid Yudu, who was executed for his role in the uprising. Naiman Chala's 2-year-old son Naiman Aguo was forced to surrender, ending the uprising; Liang Yong, seeking to ensure that his dynasty would die with him, had him castrated. On 25 March 942, Liang Yong commissioned a writer to compose his family chronicles, and he befriended High Chief Chiledu of Juyan and became an avid board game player. On 15 November 942, Liang Yong took Dehua as his third concubine. Later that year, Liang Yong prepared to campaign against Inek the Good of Altay and expand his empire, but his wounds had grown worse due to his depression and drinking. He died on 25 February 943 at the age of 28.

Road to war
The wicked king Liang Yong's death led to a succession dispute, as his eldest son Liang Yan was expected to inherit the Liao throne, while most of his nobles backed the claim of his second son Liang Jing. The rival factions at court split the empire with their rivalry, with Liang Yan reigning over a southern region as "King of Liao" while Liang Jing ruled over the vast majority of his father's lands as "Khan of Mongolia". By 10 April 943, the Liao mercenary army had defeated Inek the Good, leading to Liao gaining an exclave on former Altai lands. Meanwhile, Wang Anshi had assumed the regency for Liang Jing, and he sought to reunite the country under his lord's rule. On 10 April 943, Liang Jing declared war on Liang Yan to claim Liao, leading to a civil war between the two brothers.

War
Liang Jing began the war by hiring mercenary forces to fight against his brother's mercenary army, and he also arranged his betrothal to the sister of Cao Yijin, Cao Wanyi, hoping to gain the support of the powerful Cao clan. On 21 September 943, however, Jing's mercenary army suffered a major defeat at Yizhou, preventing Jing from conquering the south. On 11 March 944, Jing's new mercenary army defeated Yan's mercenary army at Aj Bogd, and then again on 13 November 944 at Juyan. Over the next several years, Liang Jing's mercenary army laid siege to the various Liao towns across Central Asia, storming them and easily taking them. On 13 May 945, Jing's army took Dunhuang, capturing Cao Yuanzhong, his wife Temulun, and Cao Yuande's son Cao Yu. At the 7 October 945 battle of Anxi, the rebel general Miao Na was captured. This was the last major battle of the war, and Yan surrendered to Jing on 10 June 947.

Aftermath
Liang Jing became Khan of Mongolia and King of Liao, and he soon adopted "King of Liao" as his primary title, having reunified his father's domains. The deposed Liang Yan returned to being Count of Western Sayan, becoming a vassal of his brother. On 16 July 947, Jing had his sister Liang Miao upgraded from being imprisoned to being placed under house arrest, intending on keeping an eye on her until she could marry.

While Liang Jing focused on expanding his empire in Central Asia, his cruelty began to be felt. Miao Na died in prison on 25 June 948, and his son Miao Xingben succeeded him as Count of Yizhou. On 1 December 948, Jing had Cao Yu castrated in an attempt to eliminate the Cao clan, and, on 3 April 949, he had Cao Yuanzhong and his wife Temulun beheaded. On 5 March 949, Jing had his mother Chaogui freed from his dungeon after discovering that his forces had captured her during the storming of the Liao court, and he persuaded her to join him at his court; she also converted to Taoism. From 949 onwards, Liang Jing focused on putting down Tengri uprisings and expanding his empire, and his reputation for cruelty spread across Central Asia.