Puberty
After 1039 Krakow becomes the official capital of the Polish Kingdom in the place of the Old Piast capitals of Poznań & Gniezno and Wawel Castle the residence of the Piast King Casimir the Restorer (r. 1034–1058). A new Wawel Cathedral is erected in the place of the first one that had been burnt down by fire sometime after 1020.
Casimir took over after a turbulent decade that had almost shattered all the gains his line had accomplished for the kingdom in the recent past. In 1079 the Bishop of Krakow Stanislaus of Szczepanów would start a feud with the Piast King Boleslaw II (1058-1079) which had as a result his execution on a hill outside Krakow’s city walls & the following abdication of the king because of the pressure from the Catholic Church. Stanislaus of Szczepanów would become the second martyr and patron saint of Poland, canonized in 1253. (St. Stanislaus).
In 1138 Boleslaw III divides the kingdom before his death into five principalities, among four of his sons, with Krakow becoming the Seniorate Province, given to the senior among the princes, who as the Grand Duke of Krakow would serve as the overlord of the rest of dukes.
The fragmentation of Poland into smaller duchies caused a century-long struggle between Boleslaw III’s descendants who in 1241 had to face the invading Mongols who devastated the country & ravaged the deserted by its citizen’s city of Krakow.
By the year 1257, the city had been rebuilt & many of its destroyed buildings had been replaced by new ones built in the Gothic style. New fortifications and defensive towers that would encircle the city became a matter of priority.
Before the work was finished however the Mongols returned again (1259) finishing their destructive work. After the two attacks & the disaster that had been caused by them, a 3 km defensive wall as high as ten meters and 2.5-meter thick, enhanced with battle towers & fortified gates was finally completed by the first quarter of the 14th century.
Krakow was given trade privileges & self-government and its citizens’ substantial tax benefits by king Boleslaw V the Chaste (r. 1243–1279), who boosted Krakow’s growth & modernization. In 1287 a new attack by the Mongols was this time repelled with the help of the new fortifications.