The Second Goryeo-Khitan War was an 11th-century conflict between the kingdom of Goryeo and the Liao dynasty  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, Liao invested his successor Wang Song as king of Goryeo . 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. The Khitan withdrew after Goryeo reaffirmed its tributary relationship with the Khitan.. How many years after the second Goryeo-Khitan war did the third Goryeo-Khitan war happen?