The town shared the history of Silesia, and after the feudal division of Poland, Piast dukes of the Silesian line ruled the area. Cieszyn became a seat of the Duchy of Cieszyn. In 1327 Kazimierz I swore homage to the Bohemian and titular Polish king John of Luxembourg. Since then, Cieszyn became an autonomic fiefdom of the Bohemian crown. As a capital city of the Duchy, Cieszyn developed quickly and increased its significance. It also became a religious center of the duchy, after creation of a deaconry in the early 14th century. The largest development occurred during the rule of Przemysław I Noszak, who gained the city rights for Cieszyn in 1374 and reconstructed the wooden castle into the bricked one. It was back then when the mayor and city council appeared, in 1387 first known mayor being Mikołaj Giseler. Town hall for the city council has been built.