On 18 January 1823, Pedro I created the Emperor's Battalion, a handpicked elite infantry unit that included Luís Alves, who was named as adjutant to the company's commander, his uncle, Colonel José Joaquim de Lima e Silva. The Emperor's Battalion was sent to the province of Bahia in the northeast on 28 January and placed, along with other troops, under the command of French Brigadier Pierre Labatut. The Brazilian imperial forces besieged Bahia's capital, Salvador, which was held by the Portuguese. During the siege, Luís Alves fought in at least three attacks (on 28 March, 3 May and 3 June) against Portuguese positions around Salvador, all successful. In the engagement on 28 March, he led a charge on an enemy bunker.