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.
Socialist Republic of Romania
When King Michael, supported by the main political parties, overthrew Ion Antonescu in August 1944, breaking Romania away from the Axis and bringing it over to the Allied side, Michael could do nothing to erase the memory of his country's recent active participation in the German invasion of the Soviet Union. Romanian forces fought under Soviet command, driving through Northern Transylvania into Hungary proper, and on into Czechoslovakia and Austria. However, the Soviets treated Romania as conquered territory, and Soviet troops remained in the country as occupying forces under the pretext that Romanian authorities could not guarantee the security and stability of Northern Transylvania.