After the Hungarian troops occupied the western Galician territories, Leszek made an alliance with Mstislav Mstislavich, Prince of Novgorod. Mstislav invaded Halych, forcing Coloman and his supporters to flee to Hungary, most probably in early 1219. Mstislav supported his son-in-law, Daniel Romanovichwho had claimed Halych since 1205to invade Polish territories, which brought about a reconciliation between Andrew II and Leszek. The Hungarians and Poles again occupied Halych and restored it to Coloman in the autumn of 1219. Mstislav and his Cuman allies defeated the Hungarians near Halych and captured Coloman and Salomea in August 1221. To secure their release, Andrew II renounced Halych and arranged a marriage alliance between his youngest son, Andrew, and Mstislav's daughter.