Next year, he succeeded his father as Marquis of Torre Tagle (although he only received a provisional confirmation by the king in 1810) and inherited the post of Comissar of War and Navy of the Fortress of Callao.
During this time, Tagle sent a petition to the King requiring his appointment as Intendant of Tarma or Trujillo, but he only obtained a similar post to La Paz, which is why he remained in Spain some years.
After the independence was proclaimed by San Martín in July 1821, Tagle was appointed General Inspector of the Civic Guard and Commander-in-Chief of the Peruvian Legion.
After the departure of San Martin for Chile, on 20 September, Torre Tagle was elected member of the triumvirate under José de La Mar.
After the deposition of Riva Agüero and his retreat to Trujillo, Torre Tagle was appointed president by Antonio José de Sucre on 20 July, and elected by the congress on 16 August, and Bolivar, who on his arrival 1 September had been proclaimed dictator, left him in charge of the government.
During his tenure, the Peruvian flag, which had been established by José de San Martín, was changed due to its complex elaboration.