Second conflict in the Goryeo–Khitan War

The Second Goryeo-Khitan War was an 11th-century conflict between the Goryeo dynasty of Korea and the Khitan-led Liao dynasty of China near what is now the border between China and North Korea. It was the second of the Goryeo-Khitan Wars, with the First Goryeo-Khitan War occurring in 993, the second in 1010, and the third in 1018.

When King Seongjong died in 997, the Liao dynasty invested his successor Wang Song as king of Goryeo (King Mokjong, r. 997-1009). In 1009, he was assassinated by the forces of the general Kang Cho. Using it as a pretext, the Liao attacked Goryeo in the next year. They lost the first battle but won the second one, and Kang Cho was captured and killed. The Liao army occupied several border prefectures to the north. The Goryeo king offered to surrender but the governor of Kaesong, the capital of Goryeo, killed the Liao envoys and opted to resist. The Liao won a pitched battle at Kaesong and occupied the city, however the Goryeo king had already escaped to Naju. Kaesong was sacked and its palaces, official buildings, and archives were destroyed. The Goryeo king fled to the south and his armies regrouped. The Liao began their withdraw but the surrendered districts rose up against them. Mired down in the mountains during the winter, the Liao forces were forced to abandon most of their armour and weapons before retreating north of the Yalu. Afterward Goryeo promised to reaffirm its tributary relationship with the Liao dynasty. The Goryeo king sued for peace, but the Liao emperor demanded that he come in person and also cede key border areas; the Goryeo court refused the demands, resulting in a decade of hostility between the two nations, during which both sides fortified their borders in preparation of war. Liao attacked Goryeo in 1015, 1016, and 1017, but the results were indecisive.