However, the Spanish did not resist the Portuguese expansion of Brazil across the meridian. The Treaty of Tordesillas was rendered meaningless between 1580 and 1640 while Spain controlled Portugal. The creation of Viceroyalties of New Granada and Rio de la Plata (at the expense of Peru's territory) reduced the importance of Lima and shifted the lucrative Andean trade to Buenos Aires, while the fall of the mining and textile production accelerated the progressive decay of the Viceroyalty of Peru. Eventually, the viceroyalty would dissolve, as with much of the Spanish empire, when challenged by national independence movements at the beginning of the nineteenth century. These movements lead to the formation of modern-day republics of Peru, Chile, Colombia, Ecuador, Bolivia, Paraguay, Uruguay and Argentina in the territories that at one point or another had constituted the Viceroyalty of Peru.
After the Spanish conquest of Peru (1532–37), the first Audiencia was constituted. In 1542, the Spanish created the Viceroyalty of New Castilla, that shortly afterwards would be called the Viceroyalty of Peru. In 1544, Holy Roman Emperor Charles V (King Charles I of Spain) named Blasco Núñez Vela Peru's first viceroy, but the viceroyalty was not organized until the arrival of Viceroy Francisco de Toledo in 1572. Toledo made an extensive tour of inspection of the colony.
Francisco de Toledo, "one of the great administrators of human times", established the Inquisition and promulgated laws that applied to both Indians and Spanish alike, breaking the power of the encomenderos and reducing the old system of mita, or forced native labor. He improved the safety in the viceroyalty with fortifications, bridges and la Armada del Mar del Sur (the Southern Fleet) against the pirates. Francisco de Toledo also ended the indigenous state of Vilcabamba, executing the Inca Tupac Amaru, and promoted economic development from the commercial monopoly and the mineral extraction, mainly, from silver mines of Potosí.
The Amazon basin and some large adjoining regions had been considered Spanish territory since the Treaty of Tordesillas and explorations such as that by Francisco de Orellana, but the Treaty of Tordesillas was rendered meaningless between 1580 and 1640 while Spain controlled Portugal. However, Luis Jerónimo Fernández de Cabrera sent out the third expedition to explore the Amazon River, under Cristóbal de Acuña. (This was part of the return leg of the expedition of Pedro Teixeira.)
Many Pacific islands were visited by Spanish ships in the sixteenth century, but they made no effort to trade with or colonize them. These included New Guinea (by Yñigo Ortiz de Retez in 1545), the Solomon Islands (by Pedro Sarmiento de Gamboa in 1568) and the Marquesas Islands (by Álvaro de Mendaña de Neira in 1595).
The first Jesuit reduction to convert and "civilize" the Indigenous population was founded in 1609, but some areas were occupied by Brazilians as Bandeirantes gradually extended their activities throughout much of the basin and adjoining Matto Grosso in the 17th and 18th centuries. These groups had the advantage of remote geography and river access from the mouth of the Amazon (which was in Portuguese territory). Meanwhile the Spanish were barred by their laws from slaving of indigenous people, leaving them without a commercial interest deep in the interior of the basin.
One famous attack upon a Spanish mission in 1628 resulted in the enslavement of 60 000 indigenous people. In fact as time passed they were used as a self funding occupation force by the Portuguese authorities in what was effectively a low level war of territorial conquest.
In 1617, Francisco de Borja y Aragón divided the government of Río de la Plata into two, Buenos Aires and Paraguay, both dependencies of the Viceroyalty of Peru. Viceroy Borja y Aragón also established the Tribunal del Consulado, a special court and administrative body for commercial affairs in the viceroyalty. Diego Fernández de Córdoba, Marquis of Guadalcázar reformed the fiscal system and stopped the interfamily rivalry that was bloodying the domain.
Other viceroys, such as Fernando Torres, Borja y Aragón, Fernández de Cabrera or Fernández Córdoba also expanded the colonial navy and fortified the ports to fight against pirate attacks, as those lead by the Englishman Thomas Cavendish. Fernández de Cabrera suppressed an insurrection of the Uru and Mapuche Indians.
Viceroys had to protect the Pacific coast from French contraband and English and Dutch pirates. They expanded the naval forces, fortified the ports of Valdivia, Valparaíso, Arica and Callao and constructed city walls in Lima (1686) and Trujillo) (1685–1687). Nevertheless, the famous English privateer Henry Morgan took Chagres and captured and sacked the city of Panama in the early part of 1670. Also Peruvian forces repelled the attacks by Edward David (1684 and 1686), Charles Wager and Thomas Colb (1708) and Woldes (1709–1711). The Peace of Utrecht allowed the British to send ships and merchandise to the fair at Portobello.
In this period, revolts were common. Around 1656, Pedro Bohórquez crowned himself Inca (emperor) of the Calchaquí Indians, inciting the indigenous population to revolt. From 1665 until 1668, the rich mineowners José and Gaspar Salcedo revolted against the colonial government. The clergy were opposed to the nomination of prelates from Spain. Viceroy Diego Ladrón de Guevara had to take measures against an uprising of slaves at the hacienda of Huachipa de Lima. There were terrible earthquakes (1655, 1687) and epidemics, too.
During Baltasar de la Cueva Enríquez's administration, the laws of the Indies were compiled. Diego de Benavides y de la Cueva issued the Ordenanza de Obrajes (Ordenance of Manufactures) in 1664 and Pedro Álvarez de Toledo y Leiva introduced the papel sellado (literally, sealed paper). In 1683 Melchor de Navarra y Rocafull reestablished the Lima mint, which had been closed since 1572. Viceroy Diego Ladrón de Guevara increased the production of silver in the mines of Potosí, and stimulated production in other mines at San Nicolás, Cojatambo and Huancavelica. He limited the manufacture of aguardiente from sugar cane to authorized factories, which he taxed heavily.
The Churches of Los Desamparados (1672), La Buena Muerte and the convent of Mínimos de San Francisco de Paula were finished and opened. The Hospital of Espiritu Santo in Lima and San Bartolomé hospital were built.
Several viceroys had scientific, political and economic impact on the Viceroyalty. Manuel de Amat y Juniet organized an expedition to Tahiti. Viceroy Teodoro de Croix also decentralized the government through the creation of eight intendencias in the area of the Audiencia of Lima, and two in the Captaincy General of Chile. Francisco Gil de Taboada reincorporated the region of Puna into the Viceroyalty of Peru. José de Armendáriz stimulated the production of silver and took steps against fraud, corruption and smuggling. Amat y Juniet established the first Regulation of Commerce and Organization of Customs rules, which led to the building of the customshouse in Callao. Teodoro de Croix collaborated in the creation of the Junta Superior de Comercio and the Tribunal de Minería (1786).
An earthquake demolished Lima and Callao, in 1746. Viceroy Amat y Juniet constructed various public works in Lima, including the first bull ring. Manuel de Guirior also improved the medical care at ten hospitals in Lima and established a foundling home.
Nevertheless, throughout this period, the Native peoples were not entirely suppressed. In the eighteenth century alone, there were fourteen large uprisings, the most important of which were that of Juan Santos Atahualpa in 1742, and the Sierra Uprising of Tupac Amaru II in 1780. The Comunero Revolt broke out in Paraguay from 1721 to 1732). In 1767, the Jesuits were expelled from the colony.
Viceroy José Fernando de Abascal y Sousa promoted educational reforms, reorganized the army, and stamped out local rebellions. During his administration, the Inquisition of Lima was temporarily abolished as a result of the reforms taken by the Cortes in Spain.
When the wars of independence broke out in 1810, Peru was the center of Royalist reaction. Abascal reincorporated the provinces of Córdoba, Potosí, La Paz, Charcas, Chile and Quito (Ecuador) into the Viceroyalty of Peru.
In 1812 occurred the great fire of Guayaquil that destroyed half the city.
Lord Thomas Cochrane, in command of the newly created Chilean Navy, unsuccessfully attacked Guayaquil and El Callao, but on 4 February he captured Valdivia, called at the time The Key of the South Seas and the Gibraltar of the Pacific, due to its huge fortifications. However the viceroyalty managed to defend Chiloé Island until 1826.
On September 8, 1820, the Expedición Libertadora of Peru, organized in Chile, landed on the beach at Paracas, near the city of Pisco, Peru. The army was under the command of José de San Martín. After fruitless negotiations with the viceroy, San Martín occupied the Peruvian capital of Lima on July 21, 1821. The independence of Peru was proclaimed on July 28, 1821. Viceroy José de la Serna e Hinojosa, still in command of a sizable military force, retired to Jauja, and later to Cusco.
On July 26, 1822, San Martín and Simón Bolívar met in Guayaquil to define a strategy for the liberation of the rest of Peru. The meeting was secret, and exactly what occurred is not known. However, afterwards San Martín returned to Argentina while Bolívar prepared to launch an offensive against the remaining royalist forces in Alto Peru. In September 1823 Bolívar arrived in Lima with Antonio José de Sucre to plan the offensive.
In February 1824 the royalists briefly regained control of Lima. Having regrouped in Trujillo, Bolívar in June led his rebel forces south to confront the Spanish under Field Marshal José de Canterac. The two armies met on the plains of Junín on August 6, 1824, and the Peruvians were victorious in a battle fought entirely without firearms. The Spanish troops subsequently evacuated Lima for a second time.
Royalist control was now reduced to a small area around the city of Ayacucho, located in the south-central highlands. It was there that the final battle for the independence of Peru would be fought.
On 9 December 1824, the Battle of Ayacucho, or Battle of La Quinua, took place at Pampa de La Quinua, a few kilometers away from Ayacucho, near the town of Quinua. This battle — between royalist (Spanish) and nationalist (republican) troops — sealed the independence of Peru and South America. The victorious nationalist forces were led by Antonio José de Sucre, Bolívar's lieutenant. Viceroy Serna was wounded and taken prisoner. The Spanish army had 2,000 dead and wounded and lost 3,000 prisoners, with the remainder of the army entirely dispersed. After the battle, Serna signed the final capitulation whereby the Spaniards agreed to leave Peru. Serna was released soon afterwards and sailed for Europe.
Spain made futile attempts to regain its former colonies, such as at the Battle of Callao, but in 1879 it finally recognized Peru's independence.
The town of Lima, founded by Pizarro on January 18, 1535 as the "Ciudad de los Reyes" (City of the Kings/Magi), became the seat of the new viceroyalty. As the seat of a viceroy, who had oversight over all of Spanish South America except for Portuguese-dominated Brazil, Lima grew into a powerful city. During the 16th, 17th and most of the 18th centuries, all of the colonial wealth of South America created by the silver mines passed through Lima on its way to the Isthmus of Panama and from there to Seville, Spain. The rest of the viceroyalty dependent upon Lima in administrative matters, in a pattern that persists until today in Peru. By the start of 18th century, Lima had become a distinguished and aristocratic colonial capital, seat of the 250-year-old Royal and Pontifical University of San Marcos and the chief Spanish stronghold in the Americas.
At ground level during the first century, Spanish encomenderos depended on local chieftains (curacas) to gain access to the Indian population's tribute labor, even the most remote settlements, and therefore, many encomenderos developed reciprocal, if still hierarchical, relationships with the curacas. By the end of the 16th century the quasi-private encomienda had been replaced by the repartimiento system (known in Peru by the Quechua term, mita), which was controlled by local crown officials.
Politically the viceroyalty was further divided into audiencias, which were primarily superior tribunals, but which also had administrative and legislative functions. Each of these was responsible to the Viceroy of Peru in administrative matters (though not in judicial ones). Audiencias further incorporated the older, smaller divisions known as "governorships" (gobernaciones, roughly provinces) headed by a governor. (See, Adelantado.) Provinces which were under military threat were grouped into captaincies general, such as the Kingdom of Chile (established in 1541 and established as a Bourbon captaincy general in 1789), and which were joint military and political commands with a certain level of autonomy. (The viceroy was captain-general of the provinces which remained directly under his command).
At the local level there were hundreds of districts, in both Indian and Spanish areas, which were headed by either a corregidor (also known as an alcalde mayor) or a cabildo (town council), both of which had judicial and administrative powers. In the late 18th century the Bourbon dynasty began phasing out the corregidores and introduced intendants, whose broad fiscal powers cut into the authority of the viceroys, governors and cabildos. (See Bourbon Reforms.)
Once the Viceroyalty of Peru was established, gold and silver from the Andes enriched the conquerors, and Peru became the principal source of Spanish wealth and power in South America. The first coins minted for Peru (and indeed for South America) appeared between 1568 and 1570. Viceroy Manuel de Oms y de Santa Pau was able to send back an enormous sum of money (1,600,000 pesos) to the king to cover some of the costs of the War of the Spanish Succession. This was possible in part because of the discovery of the mines in Caraboya. The silver from mines at Potosí circulated around the world.
Viceroy José de Armendáriz reestablished the system whereby Inca nobles who could prove their ancestry were recognized as hijosdalgos of Castile. This led to a frenzy on the part of the Indigenous nobility to legitimate their status.
In the 1790s Viceroy Francisco Gil de Taboada ordered the first official census of the population.
The last cargo of black slaves in Peru was landed in 1806. At that time an adult male slave sold for 600 pesos.
On the death of the Peruvian astronomer Doctor Francisco Ruiz Lozano, Viceroy Melchor Liñán y Cisneros (with the approval of the Crown) gave mathematics a permanent position in the University of San Marcos. Mathematics was attached to the chair of cosmography. Doctor Juan Ramón Koening, a Belgian by birth, was named to the chair. . Viceroy Manuel de Guirior created two new chairs at the university.
Francisco de Borja y Aragón also founded, in Cuzco, the Colegio del Príncipe for sons of the Indigenous nobility and the Colegio de San Francisco for sons of the conquistadors. Manuel de Amat y Juniet founded the Royal College of San Carlos.
The first books printed in Peru were produced by Antonio Ricardo, a printer from Turin who settled in Lima. Diego de Benavides y de la Cueva built the first theater in Lima. Manuel de Oms y de Santa Pau founded a literary academy in 1709 and promoted weekly literary discussions in the palace that attracted some of Lima's best writers. These included the famous Criollo scholar Pedro Peralta y Barnuevo and several Indigenous poets. Oms introduced French and Italian fashions in the viceroyalty. The Italian musician Rocco Cerruti (1688–1760) arrived in Peru. Francisco Gil de Taboada supported the foundation of the newspaper El Mercurio Peruano in 1791 and founded the Academy of Fine Arts.
Jesuit Barnabé de Cobo (1582–1657), who explored Mexico and Peru, brought the cinchona bark from Lima to Spain in 1632, and afterwards to Rome and other parts of Italy.
In 1737 Jorge Juan y Santacilia and Antonio de Ulloa, Spanish scientists sent by the French Academy on a scientific mission to measure a degree of meridian at the equator, arrived in the colony. They also had the mission of reporting on disorganization and corruption in the government and smuggling. Their report was published later, under the title Noticias Secretas de América (Secret News From America).
Manuel de Guirior assisted the scientific expedition of Hipólito Ruiz López, José Antonio Pavón and Joseph Dombey, sent to study the flora of the viceroyalty. The expedition lasted from 1777 to 1788. Their findings were later published as La flora peruana y chilena (The Flora of Peru and Chile). Again a major concern was stimulating the economy, which Guirior did by adopting liberal measures in agriculture, mining, commerce and industry.
Another French influence on science in the colony was Louis Godin, another member of the meridian expedition. He was appointed cosmógrafo mayor by Viceroy Mendoza. The duties of cosmógrafo mayor included publishing almanacs and sailing instructions. Another French scientist in Peru at this time was Charles Marie de La Condamine.
The Balmis Expedition arrived in Lima on May 23, 1806. At the same time these viceroys adopted rigorous measures to suppress the thought of the Encyclopedists and revolutionaries in the United States and France.
On 1671, Saint Rose of Lima was canonized by Pope Clement X. Rose was the first native-born American to become a Catholic saint. Pope Benedict XIII elevated another two important Peruvian saints, Toribio Alfonso de Mogrovejo and Francisco de Solano.
Diego Quispe Tito was a famous artist before the age of Independence.