Hungary–Romania relations
During World War II, Hungary and Romania became allies and participated in the war against the Soviet Union. But after the coup on 23 August 1944 Romania switched sides and fought against Hungary. Consequently, Soviet and Romanian troops invaded Hungary, occupied Northern Transylvania by October 1944 and re-established the Romanian administration in the region in March 1945. The 1947 Treaty of Paris reaffirmed the borders between Romania and Hungary as originally defined in Treaty of Trianon 27 years earlier, thus confirming the return of Northern Transylvania to Romania.
Unification of Romania and Moldova
In 1940, during World War II, Romania agreed to an ultimatum and ceded Moldova to the Soviet Union, which organized it into the Moldavian SSR. In the middle of 1941, Romania joined Hitler's Axis in the invasion of the Soviet Union, recovering Bessarabia and northern Bukovina, as well as occupying the territory to the east of the Dniester it dubbed "Transnistria". By the end of World War II the Soviet Union had reconquered all of the lost territories, reestablishing Soviet authority there. The Soviets strongly promoted the Moldovan ethnic identity, against other opinions that viewed all speakers of the Romanian language as part of a single ethnic group, taking advantage of the incomplete integration of Bessarabia into the interwar Romania.