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 in World War II
Under the 1947 Treaty of Paris, the Allies did not acknowledge Romania as a co-belligerent nation but instead applied the term "ally of Hitlerite Germany" to all recipients of the treaty's stipulations. Like Finland, Romania had to pay $300 million to the Soviet Union as war reparations. However, the treaty specifically recognized that Romania switched sides on 24 August 1944, and therefore "acted in the interests of all the United Nations". As a reward, Northern Transylvania was, once again, recognized as an integral part of Romania, but the border with the USSR was fixed at its state on January 1941, restoring the pre-Barbarossa status quo (with one exception). Following the dissolution of the Soviet Union in 1991, the Eastern territories became part of Ukraine and the Republic of Moldova.