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 I
Despite initial successes, the Romanian forces (aided by Russia) suffered massive setbacks, and by the end of 1916 only Moldavia remained. After several defensive victories in 1917, with Russia's withdrawal from the war following the October Revolution, Romania, almost completely surrounded by the Central Powers, was also forced to drop out of the war; it signed the Treaty of Bucharest with the Central Powers in May 1918. On 10 November 1918, just one day before the German armistice and after all the other Central Powers had already capitulated, Romania re-entered the war after the successful Allied advances on the Macedonian Front.