 During the Napoleonic Wars, the city was taken by 1,500 Polish soldiers under the leadership of general Michał Sokolnicki in 1807.In 1815 Słupsk became one of the cities of the Province of Pomerania (1815–1945), in which it remained until 1945.In 1869 a railway from Danzig (Gdańsk) reached Stolp.