Millions of Poles lived within the Russian Empire following the military Partitions of Poland throughout the 19th century. As Austria, Germany, and Russia took over Polish lands during World War I, many Poles were evacuated or ran away with retreating Russian troops. As the Russian Revolution of 1917 began in Petrograd, followed by the Russian Civil War, the majority of the Polish population saw cooperation with the Bolshevik forces as betrayal and treachery to Polish national interests. Polish writer and philosopher Stanisław Ignacy Witkiewicz lived through the Russian Revolution while in St. Petersburg. What he saw, had a profound effect on his works, many of which display themes of the horrors of Bolshevism he witnessed. Among the many Polish victims of the revolution was the father of Polish eminent composer Witold Lutosławski, Marian Lutosławski and his brother Józef, murdered in Moscow in 1918 as alleged "counter-revolutionaries".
There were also people of Polish background associated with the communist movement, though very minor and usually they were of Jewish descent rather than ethnic Polish. Famous revolutionaries include Konstantin Rokossovsky, Julian Marchlewski, Karol Świerczewski and Felix Dzerzhinsky, founder of the Cheka secret police which would later turn into the NKVD. However, according to their ideology they did not identify as Poles or with Poland, and members of the communist party viewed themselves as Soviet citizens without any national sentiments. They were also equally viewed by Poles as betrayers to their people and nation. The Soviet Union also "organized" Polish units in the Red Army and a Polish Communist government-in-exile, however these organisations were Polish in name only and led by non-Poles, Russians in the case of the "Polish Army". Provisional Polish Revolutionary Committee was created in 1920 but failed to control Poland.
Polish communities were inherited from Imperial Russia after the creation of the Soviet Union. After World War I, Poland reestablished itself as an independent country, and its borders with the USSR were finalized by the Peace of Riga in 1921 at the end of the Polish-Soviet War, which left significant territories populated by Poles within the Soviet Union. According to the 1926 Soviet census, there were a total of 782,334 Poles in the USSR. The largest concentration of Poles was in West Ukraine, where according to the Soviet census in 1926 476,435 Poles lived. Those estimates are considered to have been lowered by Soviet officials. Church and independent estimates show estimates of 650,000 to 700,000 Poles living in that area. This suggests that the total Polish population of the USSR was in excess of 1,000,000. Initially the Soviets pursued a policy where the local national language was used as a tool for eradication of national identity in favour of "communist education of masses". In the case of the Poles this meant a goal of Sovietisation of the Polish population. However this proved extremely difficult as the Soviet communists themselves realised that the Poles were en masse opposed to communist ideology, seeing it as hostile to Polish identity. The policy of religious discrimination, plunder and terror further strengthened Polish resistance to Soviet rule. As a result, the Soviet authorities started to imprison and forcefully remove all those seen as an obstacle to their policies. In a short time prisons in areas with a Polish minority were overcrowded by 600%.
Two Polish Autonomous Districts were created, with one in Belarus and one in Ukraine. The first one was named Dzierzynszczyzna, after Felix Dzierżyński; the second was named Marchlewszczyzna after Julian Marchlewski. Following the failure of the Sovietisation of the USSR's Polish minority, the Soviet rulers decided to portray Poles as enemies of the state and use them to fuel Ukrainian nationalism in order to direct Ukrainian anger away from the Soviet government. After 1928 Soviet policies turned to outright eradication of Polish national identity. Special centers were established where the youth was indoctrinated towards hatred against the Polish state, all contacts with relatives within Poland were dangerous and could result in imprisonment. Newspapers printed out in the Polish language were de facto used to print anti-Polish propaganda. Following attacks on the Polish minority, from 18 February 1930 till 19 March 1930 over 100,000 people from Polish areas were expelled by the Soviet authorities.
Following the collectivization of agriculture under Joseph Stalin, both autonomies were abolished and their populations were subsequently deported to Kazakhstan in 1934–1938. Many people starved during the deportation and after, since the deported were moved to sparsely populated areas, unprepared for migration, lacking basic facilities and infrastructure. The survivors were under the supervision of the OGPU/NKVD, cruelly punished for any sign of discontent. 21,000 Poles died during the Holodomor.