José de San Martín was defeated by the Luso-Brazilian armies, his allies Estanislao López and Francisco Ramírez continued hostilities against Buenos Aires for its inactivity against the invasion. Pueyrredón called the Army of the Andes and the Army of the North (led by Belgrano) to aid Buenos Aires in the conflict. Guido noted to San Martín that if both armies did that, the north of Argentina and Chile would be easily reconquered by the royalists. San Martín also knew that most of the soldiers of the Army of the Andes would not be willing to aid Buenos Aires in the civil war, as most
José Bernardo de Tagle y Portocarrero, Marquis of Torre Tagle member of the triumvirate under José de La Mar. In January 1823, the congress appointed him president, but a military mutiny deposed him and proclaimed José de la Riva Agüero president on 28 February. 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,