The town's inhabitants took part in the Kościuszko Uprising of 1794, however, the following year it was annexed by Prussia in the Third Partition of Poland. In 1807 it was included in the short-lived Polish Duchy of Warsaw, and in 1815 it became part of so-called Congress Poland within the Russian Partition of Poland. Many inhabitants took part in several battles of the Polish January Uprising of 1863–1864 against Russia, and an insurgent hospital was located in Ostrów. Ostrów was subjected to anti-Polish repressions, was one of the sites of Russian executions of Polish insurgents, and there are memorials at the execution sites. Despite such circumstances, in the following decades, various Polish organizations were founded in Ostrów. In the 19th century, the town saw a significant influx of Jewish settlers as a result of Russian discriminatory policies, and according to the 1897 census, 5,660 inhabitants out of 10,471 were Jews. During World War I, it was occupied by Germany, in 1918 it became part of restored independent Poland, and in 1920 a battle was fought on the town's outskirts during the Polish–Soviet War.