 During the reign of Casimir III the Great the castle received an upgrade from wooden fortress to a stone one, and the stone fort was operational as early as in 1348.The growing trading village of Bytom was given Magdeburg Law city rights shortly afterwards, in 1358.The castle was meant to be a military outpost on the southwestern border of the Kingdom of Poland (later, the Polish-Lithuanian Commonwealth).