Evidence of human cultures in Ecuador exist from around 3500 B.C. Many civilizations rose throughout Ecuador, such as the Valdivia Culture and Machalilla Culture on the coast, the Quitus (near present day Quito) and the Cañari (near present day Cuenca).
Through a succession of wars and marriages among the nations that inhabited the valley, the region became part of the Inca Empire in 1463. When the Spanish conquistadors arrived from the north, the Inca Empire was ruled by Huayna Capac. In 1531, the Spanish conquistadors, under Francisco Pizarro, arrived to find an Inca empire torn by civil war by Huayna Capac's sons, one of which ruled the north (based in Quito) while the other ruled the south (Cuzco). Atahualpa (Quito) defeated Huascar (Cuzco) though, and conquered the entire empire for its own. Atahualpa wanted to re-establish a unified Incan empire; the Spanish, however, had conquest intentions and established themselves in a fort in Cajamarca, captured Atahualpa during the Battle of Cajamarca (1532), and held him for ransom. Despite being surrounded and vastly outnumbered, the Spanish executed Atahualpa.
Disease decimated the indigenous population during the first decades of Spanish rule. In 1563, Quito became the seat of a royal audiencia (administrative district) of Spain and part of the Vice-Royalty of Lima, and later the Vice-Royalty of Nueva Granada
It was in Quito, on August 10, 1809 (the national holiday), that the first call for independence from Spain was made in Latin America. On October 9, 1820, Guayaquil became the first city in Ecuador to gain its independence from Spain. On May 24, 1822, the rest of Ecuador gained its independence after Antonio José de Sucre defeated the Spanish Royalist forces at the Battle of Pichincha, near Quito.
Control over territory in the Amazon basin led to a long-lasting dispute between Ecuador and Peru. In 1941, amid fast-growing tensions between the two countries, war broke out. Peru claimed that Ecuador's military presence in Peruvian-claimed territory was an invasion; Ecuador, for its part, claimed that Peru had invaded Ecuador. In July 1941, troops were mobilized in both countries. This was the start of decades of tensions and war between the two countries. Ecuador and Peru reached a tentative peace agreement in October 1998, which ended hostilities, and the Guarantors of the Rio Protocol ruled that the border of the undelimited zone was indeed the line of the Cordillera del Cóndor, as Peru had been claiming since the 1940s. Still, Ecuador got a small piece of land from Peru in turn as well. The final border demarcation came into effect on May 13, 1999.
The 1970s saw a time of military governments but elections were held on April 29, 1979, under a new constitution. Jaime Roldós Aguilera was elected president, garnering over one million votes, the most in Ecuadorian history. He took office on August 10 as the first constitutionally elected president after nearly a decade of civilian and military dictatorships.
The emergence of the indigenous population (approximately 25%) as an active constituency has added to the democratic volatility of the country in recent years. The population has been motivated by government failures to deliver on promises of land reform, lower unemployment and provision of social services, and historical exploitation by the land-holding elite.