After World War I, in December 1918, the National Assembly of Romanians of Transylvania and Hungary proclaimed a union with the Kingdom of Romania. Later on, in April 1919, the newly established Hungarian Soviet Republic vowed to retake occupied territories by force, and Hungarian troops attacked Romanian formations in Transylvania. Under the command of generals Gheorghe Mărdărescu and Traian Moșoiu, the Romanian Army defeated the Hungarians and occupied Budapest in August 1919.