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.
Kingdom of Romania
Romania delayed in entering World War I, but ultimately declared war on the Central Powers in 1916. The Romanian military campaign ended in stalemate when the Central Powers quickly crushed the country's offensive into Transylvania and occupied Wallachia and Dobruja, including Bucharest and the strategically important oil fields, by the end of 1916. In 1917, despite fierce Romanian resistance, especially at Mărăşeşti, due to Russia's withdrawal from the war following the October Revolution, Romania, being almost completely surrounded by the Central Powers, was forced to also drop from the war, signing the Armistice of Focșani and next year, in May 1918, the Treaty of Bucharest. But after the successful offensive on the Thessaloniki front which put Bulgaria out of the war, Romania's government quickly reasserted control and put an army back into the field on November 10, 1918, a day before the war ended in Western Europe. Following the proclamation of the union of Transylvania with the Kingdom of Romania on December 1, 1918, by the representatives of Transylvanian Romanians gathered at Alba Iulia, Transylvania was soon united with the Kingdom, as was Bessarabia earlier in 1918, since the power vacuum in Russia caused by the civil war there allowed "Sfatul Țării", or National Council, to proclaim the Union of Bessarabia with Romania. War with the Hungarian Soviet Republic in 1919 resulted in the occupation of Budapest by Romanian troops and the end of Béla Kun's Bolshevik regime.