That came after King Michael's Coup of 23 August 1944, when Romania changed sides and joined the Allies. Thereafter, the Romanian Army fought Nazi Germany and its allies, first in Romania and later in German-occupied Hungary and Slovakia, such as during the Budapest Offensive, the Siege of Budapest, the Bratislava–Brno Offensive, and the Prague Offensive. After the Battle of Carei on 25 October 1944, all the territory of Northern Transylvania was under the control of Romanian and Soviet troops. The Soviet Union kept administrative control until 9 March 1945, when Northern Transylvania reverted to Romania.