War of Independence
The economic crises, the loss of power of Spain in Europe, the war of independence in North America and native uprisings all contributed to a favorable climate to the development of emancipating ideas among the criollo population in South America. However, the criollo oligarchy in Peru enjoyed privileges and remained loyal to the Spanish Crown. The liberation movement started in Argentina where autonomous juntas were created as a result of the loss of authority of the Spanish government over its colonies.
After fighting for the independence of the Viceroyalty of Rio de la Plata, Jose de San Martin created the Army of the Andes and crossed the Andes in 21 days, a great accomplishment in military history. Once in Chile he joined forces with Chilean army General Bernardo O’Higgins and liberated the country in the battles of Chacabuco and Maipu in 1818. On September 7th 1820, a fleet of eight warships landed in the port of Paracas under the command of general Jose de San Martin and Thomas Cochrane of the Chilean Navy. Immediately on October 26 they took control of the town of Pisco. San Martin settled in Huacho on November 12, where he established his headquarters while Cochrane sailed north blockading the port of Callao in Lima. At the same time in the north, Guayaquil was occupied by rebel forces under the command of Gregorio Escobedo.
Because Peru was the stronghold of the Spanish government in South America, Argentine patriot, General San Martin’s strategy to liberate Peru was to use diplomacy. He sent representatives to Lima urging Viceroy Pazuela that Peru be granted independence, however all negotiations proved unsuccessful.
The Viceroy of Peru, Joaquin de la Pazuela named Jose de la Serna commander-in-chief of the loyalist army to protect Lima from the threatened invasion of San Martin. On January 29th de la Serna organized a coup against de la Pazuela which was recognized by Spain and he was named Viceroy of Peru. This internal power struggle contributed to the success of the liberating army. In order to avoid a military confrontation San Martin met the newly appointed viceroy, Jose de la Serna, and proposed to create a constitutional monarchy, a proposal that was turned down. De la Serna abandoned the city and on July 12th 1821 San Martin occupied Lima and declared Peruvian independence on July 28th 1821. He created the first Peruvian flag. Alto Peru (Bolivia) remained as a Spanish stronghold until the army of Simon Bolivar liberated it three years later. Jose de San Martin was declared Protector of Peru.
Simon Bolivar launched his campaign from the north liberating the Viceroyalty of New Granada in the Battles of Carabobo in 1821 and Pichincha a year later. In July 1822 Bolivar and San Martin gathered in the Guayaquil Conference. Bolivar was left in charge of fully liberating Peru while San Martin retired from politics after the first parliament was assembled. The newly founded Peruvian Congress named Bolivar dictator of Peru giving him the power to organize the military.
With the help of Antonio Jose de Sucre they defeated the larger Spanish army in the Battle of Junin on August 6th, 1824 and the Battle of Ayacucho on December 9th of the same year, consolidating the independence of Peru and Alto Peru. Alto Peru was later established as Bolivia.