The northern reaches of the Korean empire has a far more flucuating history than south of the Yula River, the current border of North Korea with China. Prior to 930 C.E., the historic home land of Korea lay in the northern regions of what is now China. The founding myth of Dangun originated there as well as his mythical kingdom of Gojoseon from 2333 B.C.E. Legendary Chinese prince Gija migrated to that region, establishing his legendary kindgom of Gija Joseon in 1222 B.C.E. The kingdom of Buyeo appeared out of the ruins for the Gojoseon and Gija Joseon (if they indeed existed) kingdoms, later forming the heart of the Goguryeo kingdom, which, along with Silla and Baekje, formed the Three Kingdoms of Korea. That all occured in the northern reaches of the Korean empire that now lay north of the Yula River in present day Manchuria.
Goguryeo, the successor of Gojoseon, Gija Joseon, and Buyeo, had a illustrius and mighty history. The most powerful kingdom in the Three Kingdom Period, Goguryeo resisted a Sui Dynasty attempt to incorporate Goguryeo wholesale into the Chinese Empire betweeen 598 C.E. and 614 C.E. Goguryeo so successfully repelled the invading Sui forces four times that the Sui Dynasty collapsed from the adventure. Still, mighty Goguryeo failed to repell an invasion by the southern Silla Dynasty in league with Tang Dynasty China in 668 C.E., ceasing to exist as a kingdom at that point in history. Silla, already the conquerer of Baekje, unified the three kingdoms into the Unified Silla dynasty, with the exception of the northern region of the collapsed Goguryeo kingdom. A Goguryeo general led an exodus to that region, establishing the kingdom of Balhae and inaugurating the period Korean historians call the period of the North-South States.
Balhae existed as a kingdom for the same length of time as the Unified Silla dynasty, until 926 C.E. The Unified Silla dynasty fell in 916 C.E. to the nearly emerging Goryeo dynasty, while Balhae fell to the invading Tungusic Khitan people out of Inner Mongolia who founded the Liao Dynasty in Mongolia. Many of Balhae's ruling class fled to Goryeo. They considered the northern tribes, like the Khitans, barbarians. Balhae repulsed friendly diplomatic moves by the Khitans, seeking to expand northward in the former Balhae territory instead. After a period of internal conflicts, the Khitans initiated a campaign against the small kingdom of Jeongan-guk, the Jurchen tribes near the Yalu, and Goryeo in 991 C.E.
Reimiscent of the Sui Dynasty's unsuccessful four campaigns against Goguryeo in the late 6th and early 7th centuries, the Khitan Liao Dynasty lauched a series of three invasions againt Goryeo, near the present day border of North Korea and China along the Yula River, in the late 10th and early 11th centuries. The Khitan's launched their first unsuccessful invasion in 993 C.E., the second in 1009 C.E., and the third in 1018 C.E. As with the Sui Dynasty invasions of Goguryeo, the Khitans failed to conquer Goryeo. Yet Goryeo failed to reclaim the territory in northern China held by Gorguryeo and Balhae, that territory falling from the grasp of Korea until this day.