In October of the eighth year of Kaibao in the Northern Song Dynasty (975), General Cao Bin led the army to capture Jinling, the Southern Tang Dynasty perished, and Jiangnan was included in the territory of the Northern Song Dynasty. After sweeping the south, the situation in the north took on a new look, but the Northern Han Dynasty was not settled, and the sixteen states of Yanyun were still under the control of the Liao State. Zhao Kuangyin pursued the strategy of "first the south and then the north, first the easy and then the difficult", trying to restore the glory of the Han and Tang dynasties. In August 976, he personally led the army on a five-way northern expedition to defeat the stubborn resistance of the Northern Han.
The Song army was ambitious, made rapid progress, and soon came to Jinyang, the capital of the Northern Han Dynasty. Under the city of Taiyuan, the Song army not only successfully defeated the Liao cavalry that came to the aid of the Northern Han, but also besieged the city of Taiyuan, and the Northern Han fell into crisis. However, the turning point of fate was imminent, and in 976, Zhao Kuangyin died of illness at the age of 49. Because he did not appoint a prince during his lifetime, Zhao Kuangyin's younger brother, King of Jin, and Yin Zhao Guangyi of Kaifeng Prefecture, took the opportunity to usurp the throne, and a coup d'état of "candle shadow axe" occurred. After Zhao Guangyi came to power, he temporarily suspended the attack on the Northern Han in December of the same year, allowing the Northern Han to temporarily escape the catastrophe.
In the third year of the Taiping Rejuvenation (978), Wu Yue in the south and Chen Hongjin in southern Fujian surrendered one after another, and the south was completely stable. Zhao Guangyi re-examined the Northern Han Dynasty and formulated a strategy of "clearing the periphery, first blocking Liao reinforcements, and then taking Taiyuan". In the first month of the fourth year of Taiping Xingguo (979), Song Taizong issued an official order to attack the Northern Han Dynasty and launched an all-out attack. The army was deployed in an orderly manner: Pan Mei led the army to attack Taiyuan, Guo Jin was responsible for blocking the aid of the Liao army in the north, Tian Renlang and Liu Xu were responsible for reconnoitring the city defense, Meng Xuanpu was in charge of the reinforcements of the Liao army in the east, Hou Steep was transferred from Hebei and Lei Dexiang was transferred to the east and west respectively, and Zhao Guangyi personally led the main force to fight in Zhenzhou (now Zhengding, Hebei) to attract the attention of the Liao army.
In the face of the huge Song army offensive, Liu Jiyuan, the lord of the Northern Han Dynasty, urgently asked for help from the Liao State. Liao knew that once the Northern Song Dynasty pacified the Northern Han, it would inevitably launch a war against the sixteen states of Yanyun, so it sent Yelusha as the capital and Ji Wang Enemy Lie as the supervising army, and led troops to the Northern Han to support. However, in March of the fourth year of Pingxing (979), Yelusha led his army to Baimaling and fought a fierce battle with the Song general Guo Jin, and the Liao army was defeated and retreated. In this Battle of Baimaling, the Liao army suffered another setback, and the Song army successfully stopped the Liao army that came to the aid of the Northern Han, bringing a respite to the Northern Han.
The battle situation became more and more severe for the Northern Han, and Liu Jiyuan urgently asked Zhao Guangyi to surrender, but was refused. Then, Zhao Guangyi personally commanded the general attack, and Taiyuan City fell into siege. On the sixth day of the fifth month, Liu Jiyuan gave up resistance in a desperate situation without reinforcements, the city of Taiyuan was broken, and the Northern Han Dynasty perished. Zhao Guangyi treated Liu Jiyuan leniently, was named the right general, the prince of Pengcheng County, and raised in Kaifeng with ** Houlu. The fall of the Northern Han Dynasty was the final battle in the unification war of the Northern Song Dynasty, and the 71-year situation since the fall of the Tang Empire came to a complete end, and the world was reunited.