Luís Alves would normally have begun the fourth-year classes at the Royal Military Academy in March 1822. Instead, he dropped out in December 1821 and enlisted in the 1st Fusilier Battalion. Prince Dom Pedro, son and heir of King João VI, had just embarked upon the struggle against Portugal that would lead to the independence of Brazil on 7 September 1822. The prince was later acclaimed Dom Pedro I, the first Brazilian emperor, on 12 October. Those Brazilian and Portuguese forces who remained loyal to Portugal refused to accept this outcome, which led to a war fought on several fronts across Brazil.