In September 1655, it was captured by Prince A. Trubetskoy's soldiers in the war between the Tsardom of Russia and the Polish–Lithuanian Commonwealth. In 1661, the city was recaptured by the Polish-Lithuanian army, and was exempt from paying taxes for a period of 4 years.