In 1940, after securing the assent of Nazi Germany through the Molotov–Ribbentrop Pact, the Soviet Union pressured Romania, under threat of war, into withdrawing from Bessarabia, allowing the Red Army to annex the region. The area was formally integrated into the Soviet Union: the core joined parts of the Moldavian ASSR to form the Moldavian SSR, while territories inhabited by Slavic majorities in the north and the south of Bessarabia were transferred to the Ukrainian SSR. Axis-aligned Romania recaptured the region in 1941 with the success of Operation München during the Nazi invasion of the Soviet Union, but lost it in 1944 as the tide of war changed. In 1947, the Soviet-Romanian border along the Prut was internationally recognised by the Paris Treaty that ended World War II.