In 1817 a military revolt (pronunciamento) in Lisbon was crushed by Beresford, and the leader, General Gomes Freire de Andrade, was executed; but on the 16th of August 1820, after Beresford had sailed to Brazil to secure the return of John VI., a second rising took place in Oporto.
Miguel, and Herculano, becoming involved in the unsuccessful military pronunciamento of August 1831, had to leave Portugal clandestinely and take refuge in England and France.