No one is certain of precisely when Sandomierz came to life, but as far back as the 11th century the town was classified (by chronicler Gall Anonim) as a major settlement of the Polish kingdom, along with Kraków and Wrocław.
In the 13th century repeated assaults by Tatar raiders meant that Sandomierz had to be resurrected several times, most significantly in 1260 when it was rebuilt uphill at the site it occupies today. During the reign of Kazimierz III Wielki (1333−70), Sandomierz became a significant trade hub and saw the construction of the Royal Castle, Opatów Gate and town hall. The town prospered until the mid-17th century, which saw both the arrival of the Jesuits and the invasion of the Swedes – an onslaught from which it never completely recovered.
After having survived WWII with its historic architecture relatively unscathed, the next threat came in the 1960s when the town's most significant buildings started sliding into the river. The soft silt on which Sandomierz is built (and from which its underground cellars were carved) began to give way, necessitating a large-scale rescue operation. The injection of concrete and steel into the slippery soil stabilised the city and securely tethered its architectural assets.