In the 1542, upon the death of Gostautai family's last member, the town was acquired by Polish king and Lithuanian Grand Prince Sigismund II Augustus who had the medieval stronghold remodelled into a Renaissance castle. One of the largest arsenals of Poland was located in Tykocin. It subsequently became a royal town of the Polish Crown, located within the Podlaskie Voivodeship in the Lesser Poland Province of the Polish Crown and was eventually awarded to Hetman Stefan Czarniecki for his military service during the Swedish invasion of Poland in 1661. In the 16th and 17th centuries Tykocin was granted new privileges by kings Stephen Báthory and Władysław IV Vasa. Later on, through the marriage of Czarniecki's daughters, it passed to the Branicki (Gryf coat-of-arms) family. From 1513 until the Third Partition of Poland in 1795 Tykocin was a county (powiat) seat.