With the collapse of the Russian Empire in 1917, and the defeat of Germany and Austria in 1918, the Germans withdrew from Poland allowing Józef Piłsudski to command of Warsaw on 11 November 1918 and declared Polish sovereignty. This was confirmed by the Treaty of Versailles in 1919, where Poland was given the western part of Prussia, providing access to the Baltic Sea. The city of Gdańsk, was omitted, becoming the Free City of Danzig, and the rest of Poland’s western border was drawn up in a series of plebiscites, which resulted in Poland acquiring some significant industrial regions of Upper Silesia. The eastern boundaries were established when Polish forces defeated the Red Army during the Polish-Soviet war of 1919–20.