Early life and political career
Riva Agüero was son of José De la Riva Agüero y Basso della Rovere, a Spanish aristocrat of Italian origin, member of the Della Rovere family, and the criolla María Josefa Sánchez Boquete Román de Aulestia Marquess De Montealegre de Aulestia, and married the Belgian princess Caroline Arnoldine de Looz -Corswarem. He inherited from his mother's family the title of Marquess of Montealegre de Aulestia and was baptized in the parish of San Marcelo of Lima in 1784. He spent his childhood and youth in Spain, where he was educated and later participated in the wars against the Napoleonic invasion. He moved to France for a time and then, when he was back in Madrid, was awarded with La Orden of Carlos III (1807). Moved by the nationalist ardor caused by the Napoleonic invasion in 1808, he enlisted in the Spanish army and participated in some early actions against the French in Guipúzcoa, Burgos and Córdoba. During his brief military experience, he was awarded and recognized by the Spanish Royal Crown because of the courage showed in a campaign where he saved the lives of 10 comrades after the mission's General was shot to death. In 1809, he returned to Lima and participated in the independence cause. José de San Martín named him prefect of Lima in 1822. Upon the departure of San Martín and the ensuing social instability in the country, Andrés de Santa Cruz revolted against the Peruvian Congress on February 26, 1823 and forced it to elect Riva Agüero as President. Riva Agüero proclaimed himself "President of Peru", the first to use such title.
During his short government, he suffered the entry of Spanish troops into the capital and the departure of the government towards a new installation at the port of Callao. Under this situation, Riva Agüero lost all support of the Peruvian Congress, which awaited anxiously the arrival of Simón Bolívar. He was later deposed by Antonio José de Sucre. Sucre was succeeded by José Bernardo de Torre Tagle until the arrival of Simón Bolívar. Congress had been waiting for the Venezuelan "Liberator" to come to Peru and help to consolidate the Independence of the country, and was more than willing to grant him all necessary powers.
Fearing the loss of leadership, Riva Agüero sought to conciliate with the Viceroy to prevent the arrival of Bolívar, only to be arrested and accused of high treason. He was subsequently exiled to Chile. There he wrote the Memorias y documentos para la Historia de la Independencia del Perú y causas del mal éxito que ha tenido ésta (Memories and documents for the history of the independence of Peru and causes for its failure so far), one of the most important sources for the period.
During the short-lived Peru-Bolivian Confederation Riva Agüero supported Mariscal Andrés de Santa Cruz, and became president of the Republic of North Peru in 1838. After its collapse, he retired from public life until his death in 1858.
He had five children with Caroline-Arnoldine de Looz-Corswarem. His eldest son was José de la Riva-Agüero y Looz-Corswarem.