José Bernardo de Tagle y Portocarrero, Marquis of Torre Tagle resided in Spain between 1813 and 1817. On his return to Peru, now being a brigadier, he was appointed inspector of the army, and also named Governor of Trujillo. On the arrival of José de San Martín in Peru, he was the first Peruvian officer to hoist the national flag in the north of Peru, and on 24 December 1820 proclaimed Trujillo independent. On 26 July 1822, he was appointed provisional president by San Martin when the latter went to meet Simón Bolivar in Guayaquil. After the departure of San Martin for Chile, on 20 September, Torre Tagle was elected
Palmares (quilombo) This government was confederate in nature, and was led by an elected chief who allocated landholdings, appointed officials (usually family members), and resided in a type of fortification called Macoco. Six Portuguese expeditions tried to conquer Palmares between 1680 and 1686, but failed. Finally the governor of the captaincy of Pernambuco, Pedro Almeida, organized an army under the leadership of the Bandeirantes Domingos Jorge Velho and Bernardo Vieira de Melo and defeated a palmarista force, putting an end to the republic in 1694. Palmares was the general name given by the Portuguese in Pernambuco and Alagoas to the interior districts