<P> Warsaw flourished in the late 19th century under Mayor Sokrates Starynkiewicz (1875--92), a Russian - born general appointed by Tsar Alexander III . Under Starynkiewicz Warsaw saw its first water and sewer systems designed and built by the English engineer William Lindley and his son, William Heerlein Lindley, as well as the expansion and modernisation of trams, street lighting, and gas infrastructure . </P> <P> The Russian Empire Census of 1897 recorded 626,000 people living in Warsaw, making it the third - largest city of the Empire after St. Petersburg and Moscow . </P> <P> Warsaw was occupied by Germany from 4 August 1915 until November 1918 . The Allied Armistice terms required in Article 12 that Germany withdraw from areas controlled by Russia in 1914, which included Warsaw . Germany did so, and underground leader Piłsudski returned to Warsaw on 11 November and set up what became the Second Polish Republic, with Warsaw as the capital . In the course of the Polish - Bolshevik War of 1920, the huge Battle of Warsaw was fought on the eastern outskirts of the city in which the capital was successfully defended and the Red Army defeated . Poland stopped the full brunt of the Red Army by itself and defeated the idea of the "export of the revolution". </P> <P> The history of contemporary civilisation knows no event of greater importance than the Battle of Warsaw, 1920, and none of which the significance is less appreciated...yet never had Poland's services been greater, never had the danger been more imminent . </P>

When did warsaw became the capital of poland