In November 1918, as the First World War ended, both Germany and Russia found themselves in a common position: severe political weakness and turmoil. Germany had just been defeated in battle by the Entente Powers; while in Russia, the Bolsheviks under Lenin had taken over the government, igniting a brutal civil war between the Bolsheviks and the Whites, who wished to restore Russia's monarchy. The next year at Versailles, Britain and France imposed harsh and humiliating peace terms on Germany. The Kaiser had abdicated, and political factions and free-booting former soldiers battled each other within Germany. The defeat of Germany and Austria allowed eastern European nations such as Poland, Hungary and Czechoslovakia to gain independence. Russia was excluded from the Versailles conference and denied a say in the new shape of postwar Europe.
By 1922, Russia's civil conflict had ended with the defeat of the White monarchist forces and the establishment of the Soviet Union. Germany had also mostly stabilized its internal situation after several years of turmoil, with a democratic government in place. In postwar Europe, both countries remained potentially powerful but found themselves political outsiders. As a result, Lenin's government and the German government began to consider cooperation. Germany's generals, although enemies of Bolshevism, saw in Russia a means of evading the treaty of Versailles, which constrained the size of and arms allowed to the German military. They could build and test tanks and aircraft within the Soviet Union, away from the prying eyes of Allied inspectors. The Soviets also saw benefits in such an arrangement, in terms of trade and technology transfer with Germany.
A diplomatic conference was held at Rapallo, Italy, in 1922, where the British and French snubbed German requests. German and Russian representatives at the conference then began meetings of their own. When British diplomats learned of these meetings, they understood what was going on, and urgently asked the Germans to re-open talks with them However, it was too late, as a German-Russian treaty had been already signed. The Rapallo Treaty opened the door to a decade of cooperation between the Soviet Union and Germany's Weimar Republic. Soviet factories built German military equipment, and a generation of German officers trained in Russia and got to know their Soviet counterparts. When Adolf Hitler came to power in 1933, the contacts were terminated, not to be restored until the Nazi-Soviet Pact of 1939 which was the opening act of the Second World War.