After the Third Partition of Poland (1795) Terespol briefly belonged to the Habsburg Empire. Later it was part of the Polish Duchy of Warsaw, and from 1815 to 1916, it belonged to Russian-controlled Congress Poland. The town burned in several fires, but continued to prosper, due to the construction of a highway from Warsaw to Brest (1819–1823). After the November Uprising, Terespol belonged to the Russian Imperial government. In 1855, due to the construction of Brest Fortress, Terespol was moved westwards, and all buildings in the old town were destroyed for military purposes. In 1867, a railroad to Warsaw was completed; in 1870, it was extended to Brest. As a result of Russian discriminatory regulations the town saw a large influx of Jews, who then became the town's largest ethnic group.