Lenin, leader of the new communist government of Russia, saw Poland as the bridge over which communism would pass into the labor class of a disorganized postwar Germany.
Fighting started in 1919, when Polish self-organised military units in an area known as Kresy (Belarus, Western Ukraine and Lithuania) started quarrelling with local communist units and Bolsheviks attacking from east. Eventually Polish forces took over whole area.
When Pilsudski carried out a military thrust into Ukraine in 1920 after a deal made with Symon Petliura, he was met by a Red Army counterattack that drove into Polish territory almost to Warsaw. Although many observers marked Poland for extinction and Bolshevization, Pilsudski halted the Soviet advance before Warsaw (famous Battle of Warsaw or Miracle at Vistula) and resumed the offensive. The Poles were not able to exploit their new advantage fully, however; and the Soviets were more eager to sign a peace treaty. The Soviets offered the Polish delegation as much territory as they wanted; the Poles preferred to sign a compromise (the Peace of Riga) in early 1921 that split the disputed territory in Belorussia and Ukraine between Poland and Soviet Russia. However, Poland agreed on Sovietisation of Belarus and Ukraine.
The treaty avoided ceding historically Polish territory back to the Russians. Nevertheless, numerous Polish minority in Soviet Union, that at first was given two national Polish Soviet Republic, were subsequently deported to Kasakhstan 1934-1938, around 400 000 died from hunger. (See also: genocide)
The Polish-Soviet war heavily influenced Charles De Gaulle, who was a Polish military instructor and even fought in some battles. He and Wladyslaw Sikorski were the only military officers who, basing on experiences of this war, correctly predicted how the next war would look.
It was also important time for Stalin. Many can argue that the final defeat of the Soviet army was caused by Stalin's intrigue. Moreover, in the final stage of the war, he was forced to retreat in panic. Three groups of people, that he met at his way then: Ukrainian peasants, Polish communists, and Polish officers were later subject of persecutions. Ukrainian peasants in millions were starving to death during famine organised by Stalin 1930-1934. Polish communists were decimated, and Polish minority deported to Kazakhstan during Stalin's purges 1934-1938. Polish officers were murdered en masse in the Katyn massacre in 1940.
See also: Russian Civil War