In 1772, following the First Partition of Poland, the town was annexed by the Habsburg Empire, where it remained until late 1918. In the interwar period, it returned to Poland, and belonged to the Stanisławów Voivodeship. After the invasion of Poland it was under Soviet occupation from 1939 to 1941. In June 1941 the NKVD murdered an unknown number of Poles and Ukrainians in a local prison. After that, the town was from 1941 to 1944 under German occupation. At that time, the Polish Home Army underground resistance movement operated here. During the second period of Soviet occupation in 1944–1945, the Soviets deported Polish inhabitants deep into the Soviet Union. After the war, in accordance with the Potsdam Agreement, it was taken from Poland and annexed by the Soviet Union, where it was included in the Ukrainian Soviet Socialist Republic.