The Spanish conquistador Francisco Pizarro (c.1478–1541) arrived in what is now Peru under propitious circumstances. The flourishing Inca Empire, which dominated an area that extended from Quito in present-day Ecuador to central Chile (4,023 kilometers/2,500 miles in length and 805 kilometers/500 miles wide) had been weakened by internal conflict. The half-brothers Huáscar and Atahualpa had waged a bitter struggle for the throne. When Pizarro arrived in Peru accompanied by 180 heavily armed men and 30 horses in l531, Atahualpa had gained the upper hand and ruled the empire, one of the most developed in pre-Columbian times in the Americas.
On November 15, 1532, Pizarro arrived in Cajamarca, Atahualpa's summer residence in the northern highlands of Peru. The next day, Pizarro took Atahualpa hostage. The Incas had never seen horses or experienced the wrath of modern weapons. With the element of surprise on their side, the Spanish shattered Inca resistance. While they would continue to resist the Spaniards for many years, the Incas never recovered from that first battle.
After taking Cuzco in southern Peru, Pizarro began to consolidate his empire. In the arid coastal region, where people had been living for thousands of years, he founded the city of Lima on January 6, 1535. Because it was the day of the Epiphany (Christian holiday commemorating both the revealing of Jesus as the Christ to the Gentiles in the persons of the Magi and the baptism of Jesus), he named it the "City of Kings," but the name never stuck. The city was in a convenient place, adjacent to a major river that provided plenty of fresh water and only a few kilometers from the Pacific Coast, where the Spaniards would develop the Port of Callao. The port became a major point of transfer
The kingdom of Spain designated Lima the Viceroyalty of Peru in 1542, but several years would go by before it could reassert its authority. From here, the Spaniards ruled vast areas of South America. For the next three centuries, Lima boomed as the center of government, commerce, and culture. It was the seat of the audiencia, the high court, and the headquarters for the Inquisition. The monarchs, through their delegates, and the Catholic Church were firmly in control. For most of its colonial history, Lima was a small and conservative town, confined within its protective walls. An earthquake devastated Lima in 1746. Yet, with the wealth generated by thousands of indigenous people who mined for silver and gold under horrible work conditions, the Spanish rebuilt the city with more exquisite architecture.
By the early 1800s, Lima was losing its influence. As other regions grew in importance, their residents began to resent Spain's rule and rigid trade regulations, which forced all trade to go through the port of Callao. Goods from Buenos Aires traveled over vast distances by land to get to Lima, where they were shipped to Panama, and then transferred to ships going to Spain. Santiago, in present-day Chile, and Buenos Aires were developing societies quite distinct from Lima. It was only a matter of time before they would seek their independence.
When Napoleon Bonaparte's (1769–1821; French general) forces invaded Spain in 1808, the Spanish colonies in the Americas took advantage of the favorable political turn and sought independence. Conservative Lima remained loyal to Spain, but its subordinate regions did not. Unlike other parts of South America, insurrection in Peru did not come from within its borders. In 1821, the Argentinean General Jóse de San Martín invaded Lima and forced the city's royalist troops to retreat into the mountains. The other great South American liberator, Simón Bolívar, moved in from the north to finish the job. Peru became the last mainland colony to declare its independence in July 1821. Lima later became the capital city of Peru. While it would continue to grow, it never attained the power and wealth it enjoyed during its colonial era. In the War of the Pacific (1879–83), Limeños endured another invasion, this time by Chilean soldiers who occupied the city for two years. The Peruvian government was forced into the highlands and was allowed to return only after signing a treaty favorable to Chile.
Like many other cities, the development of modern Lima is traced to the construction of railroads and roads that made it easier for people to move around the growing capital. The first train line between Lima and Callao was built in 1851. Other lines going south followed, allowing the more wealthy Limeños to move along the coast. Here, they built the wealthier communities of Miraflores and Barranco. The new roads also made it easier for people from the