In the Polish-Soviet War (1920–1921), the Soviets battled the Poles all the way back to Warsaw, but Polish forces eventually drove the Soviets out of the country.
The Soviets sued for peace and the war ended with a ceasefire in October. The Peace of Riga, signed on March 18, 1921, divided the disputed territories between Poland and Soviet Russia and established borders for Poland that would hold until September 1939. Joseph Stalin , who had served during the 1920–1921 war, would later avenge the Polish victory by having Polish veterans and their families shot or deported to Soviet labor camps during World War II, when he headed the USSR.
Soviet forces moved forward at the remarkable rate of 20 miles (32 km) a day. Grodno in Belarus fell on 19 July; Brest-Litovsk fell on 1 August. The Polish attempted to defend the Bug River line with 4th Army and Grupa Poleska units, but were able to delay the Red Army advance for only one week. After crossing the Narew River on 2 August, the Soviet Northwest Front was only 60 miles (97 km) from Warsaw. The Brest-Litovsk fortress which was to be the headquarters of the planned Polish counteroffensive fell to the 16th Army in the first attack. The Soviet Southwest Front pushed the Polish forces out of Ukraine. Stalin had then disobeyed his orders and ordered his forces to close on Zamość, as well as Lwów – the largest city in southeastern Poland and an important industrial center, garrisoned by the Polish 6th Army. The city was soon besieged. This created a hole in the lines of the Red Army, but at the same time opened the way to the Polish capital. Five Soviet armies approached Warsaw. Polish politicians tried to secure peace with Moscow on any conditions but the Bolsheviks refused.