Ongoing dissatisfaction with the government which Brazil had maintained throughout the course of its history finally reached a peak in 1817. Even with the brutal repression of the Revolt of Alfaiates and the so-called Revolution of 1817, a new revolutionary movement was brewing in Portugal, and, in 1821, the constitutionalist revolution was established in Brazil. This resulted in the decision to include Brazilian deputies in the representation of the colony in the discussion of the future Constitution. Four Bahians were elected on the 3rd of September 1821: José Lino Coutinho, Cipriano Barata, Domingos Borges de Barros and the priest Francisco Agostinho Gomes.
Nevertheless, the dissatisfaction with the ruling of the colony was not alleviated and incited the Prince Regent Don Pedro to disobey the Lisboan Court in 1822, thus becoming a key figure of support and bridging point for the Brazilian independence movement. However, in order to control and dominate the entire region, the Prince Regent substituted Brazilian officials for Portuguese officials in the commanding of the military service. Bahia was assigned the brigadier Inácio Madeira de Melo. The Chamber, declaring the decree of the appointment of the brigadier an unjust error, rejected him, denying him the right to take control of the new government. A great rift between the Portuguese and the Brazilians was created. The Portuguese soldiers took control of the city and performed a number of absurd acts, such as the invasion of the Convent of Lapa, where they assassinated the priestess Joana Angélica, who obstinately defended the door to the cloisters.
The Bahians would not accept the loss of the city and thus began a period of intense urban warfare, culminating in the great siege of Salvador, on the 2nd of July, the date on which we now commemorate the Independence of Bahia.