El Salvador was first settled by Indigenous peoples migrating from South America around 1500 BCE. The dominant group at Spanish contact was the Pipil (Nahua-speaking, related to Aztecs), who established city-states like Cuscatlán and Chalchuapa. Maya influence existed in western zones (e.g., Tazumal).
Pedro de Alvarado led the 1524 invasion. Despite fierce Pipil resistance (notably at Acajutla), the Spanish prevailed. El Salvador became part of the Captaincy General of Guatemala within the Viceroyalty of New Spain. Economy centered on indigo, then coffee; society stratified by race and land ownership.
1821: Independence from Spain. Joined the Federal Republic of Central America (1823–1839). Federation collapsed due to civil wars; El Salvador became fully sovereign in 1839.
Leftist FMLN guerrillas vs. US-backed government. ~75,000 dead. Chapultepec Peace Accords (1992) ended war, reformed military, integrated FMLN into politics.
Since 1992: Democratic elections, dollarization (2001), persistent gang violence (maras), emigration, and economic challenges. Nayib Bukele elected 2019; controversial anti-gang crackdown and institutional consolidation.