After the fall of Balhae, some Tungusic Mohe people and their descendants the Jurchen people migrated to parts of the northern Korean peninsula. During the Yuan dynasty the Jurchen peoples in northern Korea were ruled by Korean administrators appointed by the Yuan Dynasty court. The Korean Kingdoms of Goryeo and its successor Joseon fought their way up the Korean peninsula and annexed land from the Jurchen, culminating in Joseon taking total control of the Korean peninsula after seizing control of Hamgyong from the Jurchens. According to the Goryeosa, in 918, the ancient capital of Pyongyang had been in ruins for a long time and foreign barbarians were using the surrounding lands as hunting grounds and occasionally raiding the borders of Goryeo; therefore, Wang Geon ordered his subjects to repopulate the ancient capital, and soon thereafter sent his cousin Wang Sik-ryeom to defend it. In 993, the land between the border of Liao and Goryeo was occupied by troublesome Jurchen tribes, but the Goryeo diplomat Seo Hui was able to negotiate with Liao and obtain that land up to the Yalu River, citing that in the past it belonged to Goguryeo, the predecessor to Goryeo. Both Balhae remnants and miscellaneous tribal peoples like Jurchens lived in the area between the Yalu and Taedong which was targeted for annexation by Goryeo.
The Jurchens in the Yalu River region were tributaries of Goryeo since the reign of Wang Geon, who called upon them during the wars of the Later Three Kingdoms period, but the Jurchens switched allegiance between Liao and Goryeo multiple times, taking advantage of the tension between the two nations; posing a potential threat to Goryeo's border security, the Jurchens offered tribute to the Goryeo court, expecting lavish gifts in return. Under Wanyan Wuyashu's order, Shi Shihuan led Jurchen army under the invitation of anti-Goryeo Jurchens in Helandian to defeat pro-Goryeo Jurchens in the area. After subdueing Jurchens in Helandian, the Jurchen army advanced southward to chase about 1,800 remnants who defected to Goryeo. Goryeo did not hand them over but sent Im Gan to intercept the Wanyan army. However, Shi Shihuan defeated Im Gan north of the Chŏngp'yŏng wall and invaded northeastern frontier of Goryeo. Goryeo dispatched Yoon Gwan but lost a battle again. As a result, Wuyashu subjugated the Jurchen in Helandian. In 1107 Goryeo dispatched five large armies led by Yoon Gwan to Helandian. They destroyed a hundred Jurchen villages and built nine fortresses there. After a one-year battle, the Wanyan army won two fortresses but they suffered heavy losses and seven other fortresses were still held by the Goryeo forces. Jurchens offered a truce to Goryeo and Goryeo and the Jurchen achieved a settlement. As a result, Jurchens swore not to invade Goryeo and Goryeo withdrew from the nine fortresses.
There were two kinds of Jurchens: the Enemy/Treacherous Jurchens 적호 and the defensive/boundary Jurchens 번호 considered as Jianzhou Jurchens living in Korean borders. After the collapse of Yuan dynasty, Goryeo and then Joseon made the Jurchens in the area around Hamhung on the northeastern Korean peninsula submit as vassals. The Joseon Koreans tried to deal with the military threat posed by the Jurchens by using both forceful means and incentives and by launching military attacks, while at the same time they tried to appease them with titles and degrees, traded with them and sought to acculturate them by having Korean women marry Jurchens and integrating them into Korean culture. Despite these measures, fighting continued between the Jurchen and the Koreans. The Ming Yongle Emperor was determined to wrest the Jurchens out of Korean influence and have China dominate them instead. Korea tried to persuade Jurchen leader Mentemu to reject the Ming overtures, but were unsuccessful since Möngke Temür folded and submitted to the Ming. Joseon under Sejong the Great engaged in military campaigns against the Jurchen and after defeating the Odoli, Maolian and Udige clans, Joseon managed to take control of Hamgyong. This shaped the modern borders of Korea around 1450 when several border forts were established in the region.