Second conflict in the Goryeo–Khitan War participant Liao dynasty
The Second Goryeo-Khitan War (Chinese: 第二次高麗契丹戰爭; Korean: 제2차 고려-거란 전쟁) 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 Gang Jo. Using it as a pretext, the Liao attacked Goryeo in the next year. They lost the first battle but won the second one, and Gang Jo was captured and killed. The Liao occupied and burnt the Goryeo capital Kaesong, but the Goryeo king had already escaped to Naju. The Liao troops withdrew then afterward Goryeo promised to reaffirm its tributary relationship with the Liao dynasty. Unable to establish a foothold and to avoid a counterattack by the regrouped Groyeo armies, the Liao forces withdrew. Afterward, 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.