King Béla IV (1235–1270) restored the royal power, but his kingdom became devastated during the Mongol invasion (1241–1242). Following the withdrawal of the Mongol troops, several fortresses were built or enstrengthened on his order. He also granted town privileges to several settlements in his kingdom, "e.g.", Buda, Nagyszombat (today "Trnava" in Slovakia), Selmecbánya (now "Banská Štiavnica" in Slovakia) and Pest received their privileges from him. King Béla IV managed to occupy the Duchy of Styria for a short period (1254–1260), but later he had to abandon it in favour of King Ottokar II of Bohemia. During his last years, he was struggling with his son, Stephen who was crowned during his lifetime and obliged his father to concede the eastern parts of the kingdom to him. Two of his daughters, Margaret and Kinga were canonized (in 1943 and 1999 respectively) and a third daughter of his, Yolanda was beatified (in 1827). His fourth daughter, Constance was also venerated in Lviv.