After the death of his son Stanislav in 1542 the town passed to the widow of the latter, Barbara Radziwiłł, who in 1547 married the heir to the Polish throne, bringing to him the numerous possessions of the Goštautas family.
On April 10, 1572, Sigismund II Augustus transferred the town to the castellan of Vilna, Jan Hieronimowicz Chodkiewicz.
[3] During the Swedish invasion of Poland in the Great Northern War, in 1706, the castle, defended by the Cossacks, was handed over to the Swedes after a long siege and partially destroyed.
In 1760–1775, the town and the partly destroyed castle belonged to the Bishop of Vilnius Ignatius of Masala, and then by a decision of the diet (sejm) passed into the possession of the Polish-Lithuanian Commonwealth.
[4] Following the German-Soviet invasion of Poland at the start of World War II, the town was occupied by the Soviet Union and included within the Byelorussian SSR and since January 15, 1940 it was a district center.
More than 3,000 Jewish inhabitants lived in the town, swelled by an influx of refugees fleeing from central and western Poland.