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.
Romania
During World War II, Romania tried again to remain neutral, but on 28 June 1940, it received a Soviet ultimatum with an implied threat of invasion in the event of non-compliance. Again foreign powers created heavy pressure on Romania, by means of the Molotov–Ribbentrop Pact of non-aggression from 23 August 1939. As a result of it the Romanian government and the army were forced to retreat from Bessarabia as well as from northern Bukovina in order to avoid war with the Soviet Union. The king was compelled to abdicate and appointed general Ion Antonescu as the new prime minister with full powers in ruling the state by royal decree. Romania was prompted to join the Axis military campaign. Thereafter, southern Dobruja was ceded to Bulgaria, while Hungary received Northern Transylvania as result of an Axis powers' arbitration.