In 1264 king Daniel of Galicia died and Shvarn received nominal overlordship over all of Kingdom of Galicia–Volhynia as its duke. Immediately he mounted a major campaign against Poland, this time aiming for Lesser Poland. However, although joint armies managed to plunder Skaryszew, Tarczek and Wiślica, this time the campaign was less successful and the allied Ruthenian and Lithuanian armies were repelled. The Yotvingian auxiliaries were defeated by Bolesław V the Chaste at the Battle of Brańsk. The following year Bolesław mounted a counter-offensive against Shvarn and his uncle Vasilko Romanovich, and defeated the earlier on June 19, 1266 at Wrota. This weakened Shvarn's position in his own domain.