The Jurchens north of Goryeo had traditionally rendered tribute to the Goryeo monarchs and called Goryeo their "parent country", but thanks to the defeat of Liao in 1018, the Wanyan tribe of the Heishui Mohe unified the Jurchen tribes and gained in might. In 1102, the Jurchen threatened and another crisis emerged. In 1107, General Yun Gwan led a newly formed army, a force of approximately 17,000 men called the Byeolmuban, and attacked the Jurchen. Though the war lasted for several years, the Jurchen were ultimately defeated, and surrendered to Yun Gwan. To mark the victory, General Yun built nine fortresses to the northeast of the border. In 1108, however, General Yun was given orders to withdraw his troops by the new ruler, King Yejong. Due to manipulation and court intrigue from opposing factions, he was discharged from his post. Opposition factions fought to ensure the new fortresses were turned over to the Jurchen.