During the Bahia campaign, high-ranking officers mutinied against Labatut, who was taken prisoner and sent back to Rio de Janeiro. It is unlikely that Luís Alves was involved, but his uncle, Joaquim de Lima, was almost certainly part of the conspiracy and was chosen by the officers to replace Labatut. The campaign resumed, and the Portuguese withdrew from Salvador and set sail back to Portugal. On 2 July, the victorious Brazilians entered the city. The Emperor's Battalion returned to Rio de Janeiro, and Luís Alves was later promoted to captain on 22 January 1824.