The military history of the Song dynasty encompasses military activity of the Han Chinese state of Song from 960 AD with the overthrow of Later Zhou until 1279 AD when China was conquered by the Mongol-led Yuan dynasty.

Northern Song

Taizu (r. 960–975) Emperor Taizu of Song (r. 960–975), Zhao Kuangyin, was commander-in-chief of the capital guards and jiedushi of Songzhou in the Later Zhou dynasty. In 960 he was dispatched by the Grand Chancellor Fan Zhi to fight against Northern Han and the Khitans. When Zhao's army reached Chenqiao Station, his soldiers proclaimed him emperor, and the administration of Kaifeng accepted his authority. Resistance from the provincial commanders Li Yun and Li Chongjin were suppressed by Zhao's generals Murong Yanzhao and Han Lingkun. Afterwards, Zhao took over the imperial guard and dismissed all his generals with honors, gaining complete control over the former territory of Later Zhou.

Emperor Taizu then set about conquering the various states of the Ten Kingdoms. Jingnan fell in 963, Meng Chang surrendered Later Shu in 965, Liu Chang surrendered Southern Han in 970, and Southern Tang fell in 975. Campaigns against Northern Han were launched in 968 and 969, but Song forces were unable to breach the fortifications of Taiyuan.

In 969, gunpowder propelled fire arrows, rocket arrows, were invented by Yue Yifang and Feng Jisheng.

In 974, the Mo clan of Nandan submitted to Song authority

In 975, the state of Wuyue sent a group of soldiers skilled in the use of fire arrows to the Song dynasty, which used fire arrows and incendiary bombs in the same year to destroy the fleet of Southern Tang.

Taizu did not live to see China unified. He died in 976 and was succeeded by his younger brother Zhao Guangyi, posthumously Emperor Taizong of Song.

Taizong (r. 976–997)

Emperor Taizong of Song, Zhao Guangyi, finished the conquest of the remaining Ten Kingdoms. Qian Chu surrendered Wuyue in 978 and in 979, four Song armies under Pan Mei and Guo Jin marched on the capital of Northern Han, Taiyuan. The Khitans sent a relief force but were annihilated. So fell Northern Han.

In the southwest, the Song and their aboriginal allies in Guizhou attacked the Mu'ege Kingdom in 976, forcing them to retreat to Dafang County.

In 979, Taizong personally led an invasion of the Khitan Liao dynasty to retake the Sixteen Prefectures. He laid siege to Youzhou but was defeated by Khitan reinforcements led by Yelü Xiuge at the Battle of Gaoliang River.

In 980, Yang Ye and his son Yanlang (Yang Yanzhao) defeated a major Liao invasion, consisted of 100,000 troops, at the Yanmen Pass region. In 982, he scored yet again another victory; this time counterattacked Liao well into their controlled areas of the Shanxi region.

In 981, the Song invaded kingdom of Đại Cồ Việt with initial success but was ambushed and the campaign ended with Lê Hoàn accepting Song suzerainty.

In 982, Li Jipeng of the Dingnan Jiedushi surrendered to the Song, but his cousin Li Jiqian rebelled.

In 986, the Song attacked the Liao again. Song troops under Pan Mei, Cao Bin, and Yang Ye were defeated by a Liao army led personally by Empress Dowager Chengtian. Yang Ye was captured and died in captivity due to wound infection.

In 988, Emperor Shengzong of Liao personally led an invasion of Song and successfully sacked many of the border regions before retreating in the spring of 989. The Song strengthened its border garrison in the summer with a large force. When the Liao next tried to raid Song territory by bypassing the stationed army, Song general Yin Jilun forced marched in pursuit and attacked them by surprise, shattering the Liao force.

In 993, Wang Xiaopo and Li Shun rebelled in Sichuan and were suppressed by 995.

In 994, the Song deposed Li Jiqian. The Liao attacked the Song and laid siege to Zitong with 100,000 troops. They were repelled with the aid of fire arrows.

Taizong died on 9 May 997, and was succeeded by his son, Zhao Heng, posthumously Emperor Zhenzong of Song.

Zhenzong (r. 997–1022)

Emperor Zhenzong of Song did not have any stomach for war so he legitimized Li Jiqian and appeased the Tanguts to the northwest with gold, brocade, money and tea. Li Jiqian captured Lingzhou in 1002.

The Khitans immediately attacked in 998 but were forced to retreat in 1000 after failing to take key cities. They attacked again in 1001 and 1003 but were repulsed. Khitan aggression towards the Song culminated in a full-scale invasion in 1004 by Emperor Shengzong of Liao. Khitan forces penetrated as far as Chanzhou at the Yellow River, within striking distance of Kaifeng. Zhenzong, Yang Si, and Yang Yanzhao (Yanlang) marched the Song army north to meet the Khitans in combat. In January 1005, the Khitan general Xiao Dalin was killed by a giant crossbow, crippling the Khitan offensive. Peace negotiations commenced from 13 to 18 January. In the resulting peace treaty, known as the Chanyuan Treaty, the two sides agreed to delineate their current territorial boundaries and for the Song to make annual installments of 200,000 bolts of raw silk and 100,000 taels of silver to the Liao as tribute.

In 1000, Tang Fu demonstrated gunpowder pots and caltrops to the Song court and was rewarded. Trebuchets armed with bombs that behaved like flying fire were also mentioned, suggesting that they were incendiaries. In the same year, Zhuang rebels attacked Yongzhou but were defeated by Zhuang troops of the Song-allied Huang clan.

In 1001, Zhuang rebels calling themselves the Troops of Chen (chenbing) rebelled in Yizhou. Their leader, Su Chengzhun, was defeated three months later.

In 1002, Shi Pu demonstrated fireballs utilizing gunpowder to the Song court and blueprints were created for promulgation throughout the realm.

In 1004, a banquet was held for a Nong chieftain in Song territory, leading to military retaliation from Đại Cồ Việt.

In 1017, Đại Cồ Việt raided the Song dynasty.

Zhenzong died on 23 March 1022 and was succeeded by his son, Zhao Zhen, posthumously Emperor Renzong of Song. Empress Liu became regent.

Renzong (r. 1022–1063)

Emperor Renzong of Song was still a child when his father died, so Empress Liu became regent, ruling in his stead for the next 12 years until she died. By the time he came to power, the Song military had been without any practical combat experience for decades.

In 1034, Li Yuanhao of the Tanguts raided Song dynasty

In 1036, Đại Cồ Việt raided the Song dynasty.

On 10 November 1038, Li Yuanhao declared himself Emperor Jingzong of Western Xia. In the same year, the Meng clan (Zhuang people) in Yizhou of Guangnan West Circuit rebelled and was suppressed

With the proclamation of their own dynasty, the Tanguts began a protracted campaign of military aggression against the Song, lasting six years until a truce was called in 1044. The Liao dynasty took advantage of the situation and attacked the Song as well. Although ultimately repelled, the Song agreed to increase annual tribute to 200,000 taels of silver and 300,000 bolts of silk.

In 1043, the Yao people of Guiyang rebelled. It was only suppressed in 1051.

In 1044, Ou Xifan of the Ou clan rebelled in the northwest of Yizhou in Guangnan West Circuit. Ou Xifan declared the Great Tang and waged war on the Song. He was caught a year later and executed by vivisection. In the same year, the chemical formula for gunpowder appeared in the military manual Wujing Zongyao, also known as the Complete Essentials for the Military Classics. "Thunderclap bombs" and a "triple-bed-crossbow" firing fire arrows were also mentioned in the Wujing Zongyao.

In 1048, Wang Ze rebelled in Hebei and was suppressed.

In 1049, Nong Zhigao of the Zhuang people rebelled in Guangnan West Circuit. He was suppressed in 1053.

In 1055, Peng Shixi rebelled in Jinghu and was suppressed in 1058.

In 1058, rebellion broke out in Yongzhou and was suppressed in 1061.

Renzong died on 30 April 1063 and was succeeded by his cousin Zhao Zongshi, posthumously Emperor Yingzong of Song.

Yingzong (r. 1063–1067)

During Emperor Yingzong of Song's reign, the Western Xia raided Song territory in 1063 and 1066, but ultimately their emperor was wounded in action and died. Yingzong soon fell ill and died on 25 January 1067. He was succeeded by his son, Zhao Xu, posthumously Emperor Shenzong of Song.

Shenzong (r. 1067–1085)

In 1067, private trade of gunpowder ingredients was banned by the Song.

In 1072 and 1073, the Song commander Wang Shao defeated the Tibetans of Tsongkha and conquered Xizhou and Hezhou.

Lý–Song War: In November 1075, Vietnamese generals Lý Thường Kiệt and Nùng Tông Đán invaded the Song dynasty with 63,000 troops, capturing Qinzhou, Lianzhou, and destroying Yongzhou before retreating. Emperor Shenzong proclaimed that “the [Vietnamese] king Lý Càn Đức has revolted and attacked my fortresses and towns.” Nine armies were dispatched to “end this tyrannical mode of government". The next year, Song general Guo Kui invaded Đại Việt and pushed to the Cầu River, where the war reached a stalemate.

In 1076, trade of gunpowder ingredients with the Liao and Western Xia dynasties was outlawed by the Song.

Lý–Song War: The war ended in 1077 with the Vietnamese Lý monarch agreed to becoming a Song tributary in return for the withdrawal of Song troops, despite inflicting heavy casualties on the Song Imperial army.

In 1081, Song forces invaded Western Xia but forgot to bring siege weapons, resulting in a prolonged siege that caused extreme supply problems. They were forced to retreat with heavy casualties.

In 1082, Western Xia conquered Yongle, a Song fort on their borders.

In 1083, 300,000 fire arrows were produced by the Song court and delivered to two garrisons.

Emperor Shenzong of Song died on 1 April 1085 and was succeeded by his son Zhao Xu, posthumously Emperor Zhezong of Song. Empress Gao became regent.

Zhezong (r. 1085–1100) In 1098, the Western Xia retaliated against Song incursions but failed to defeat Song fortifications and sued for peace.

Emperor Zhezong of Song died on 23 February 1100 and was succeeded by his brother Zhao Ji, posthumously Emperor Huizong of Song.

Huizong (r. 1100–1126)

The Song dynasty invaded Western Xia in 1003 and the war lasted for two years before ending inconclusively.

In 1103, Hong Zhongfu reported that the Khitans and Tanguts were using the iron from Chinese coins to make their weapons. He proposed adding lead and tin to the coins to make the barbarian weapons brittle and unusable. The proposal was approved.

In 1104, the Song dynasty annexed Tsongkha, a Tibetan polity on their western borders.

In 1110, the Song army put on a firework display for the emperor including a spectacle which opened with "a noise like thunder" and explosives that light up the night. Considered by some to be the first mention of gunpowder fireworks.

The Song invaded Western Xia again in 1113. The war ended inconclusively in 1119.

In 1119, Song Jiang rebelled in Jingdong Circuit. He was suppressed in 1121.

In 1120, Fang La rebelled in Liangzhe Circuit and was suppressed.

In 1123, the Song invaded the Liao dynasty but was repelled. Zhang Jue rebelled in Pingzhou and defected to the Song but the Jin dynasty immediately retaliated and crushed his army. Zhang Jue was executed by the Song as reconciliation towards the Jin.

In November 1125, the Jin dynasty invaded the Song and occupied Shanxi and Hebei, beginning the first of the Jin–Song Wars.

On 18 January 1126, Emperor Huizong of Song abdicated to his son Zhao Huan, who succeeded him as Emperor Qinzong of Song.

Qinzong (r. 1126–1127)