The Polish–Soviet border, as of 1939, had been determined in 1921 at the Treaty of Riga peace talks, which followed the Polish–Soviet War. Under the terms of the Molotov–Ribbentrop Pact, two weeks after the German invasion of western Poland the Soviet Union invaded the portions of eastern Poland assigned to it by the Pact, followed by co-ordination with German forces in Poland. .