A major battle was fought near the city in late 1914, and as a result the city came under German occupation after 6 December but with Polish independence restored in November 1918 the local population liberated the city and disarmed the German troops.