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
As World War II ended, Romania, a former Axis member, was occupied by the Soviet Union, the sole representative of the Allies. On 6 March 1945, after mass demonstrations by communist sympathizers and political pressure from the Soviet representative of the Allied Control Commission, a new pro-Soviet government that included members of the previously outlawed Romanian Workers' Party was installed. Gradually, more members of the Workers' Party and communist-aligned parties gained control of the administration and pre-war political leaders were steadily eliminated from political life. In December 1947, King Michael was coerced to abdicate and the People's Republic of Romania was declared.