In 1945 the city was transferred to Poland as a result of the Potsdam Conference. Its German population was largely expelled by the Soviet Army and the remaining indigenous Polish inhabitants were joined mostly by Poles repatriated from the eastern provinces annexed by the Soviets.