The town remained part of the Polish–Lithuanian Commonwealth until in the Second Partition of Poland of 1793 it was annexed together with the whole region of Greater Poland by the Kingdom of Prussia. The town at first was part of the South Prussia province, was ceded to the Poznań Department of the Napoleonic Duchy of Warsaw by the 1807 Treaties of Tilsit, and upon the 1815 Congress of Vienna fell back to Prussia, administrated within the Grand Duchy of Posen. In 1818 the town became the capital of the Prussian "Kreis Meseritz" within "Regierungsbezirk Posen". After the failed Greater Poland Uprising of 1848, it was incorporated into the Province of Posen, which, with Prussia, became part of the unified German Empire in 1871. According to a 1900 census, 20.2% of the population were Polish native speakers.