The tyrannical rule of Władysław II and Agnes led to many of their subjects switching their allegiance to the junior dukes. In early 1146 the high duke's forces were finally defeated near Poznań. Władysław II escaped to Bohemia, while Agnes and her children remained in Kraków, where for some time they maintained resistance against the junior dukes from the Wawel Castle. However, the attempts to defend the city were unsuccessful and, in the end, the whole family was reunited in exile.