After the long-term power struggle Leszek the White was killed in 1227 and the Pomerelian lands got lost, when Duke Swietopelk II of Gdańsk declared himself independent. In 1232 the Silesian duke Henry I the Bearded finally prevailed, re-uniting the thrones of Wrocław and Kraków under his rule as determined by the will of late Duke Bolesław III Krzywousty in 1138. However, a re-establishment of the Polish kingdom under the rule of the Silesian Piasts failed, when Duke Henry's I son Henry II the Pious was killed during the Mongol invasion at the 1241 Battle of Legnica. After an interregnum he was succeeded by Leszek's I son Bolesław V the Chaste, who upon his death in 1279 appointed Konrad's grandson Leszek II the Black of Kuyavia.