The area that is now Ecuador was inhabited as early as 3500 B.C. by people belonging to the Valdivia culture. By 100 A.D. four groups—the Esmeralda, the Manta, the Huancavilca, and the Puna—lived along the coast. They engaged in hunting, fishing, farming, and trading.

Inland-dwelling people included the Pasto, the Panzaleo, the Puruha, the Canari, the Palta, and the Cara. Primarily farmers, they employed irrigation to grow beans, corn, potatoes, and squash. The Cara founded a prosperous kingdom called Quito about 980 A.D.

In the 15th century, the Inca empire, which was centered in Cuzco, began expanding north. In 1463, the Inca ruler, Pachacuti, sent an army led by his son Topa to conquer the various tribes in what is now Ecuador. By 1500 conquest of the area was complete. Under Inca rule, new crops such as coca and sweet potatoes were introduced. All private and communal land became property of the empire and tribute was paid to a central authority. Inca colonization helped spread their language, quechua, into Ecuador.

The death of the Inca emperor Huayana Cápac in 1527 brought about a struggle over succession. A civil war ensued, which depleted the empire's resources and lessened its ability to control its vast domain. The Incas were left in such a weakened state that when the Spanish conquistador Francisco Pizarro invaded in 1531 he easily destroyed the empire. Ecuador was brought under Spanish rule by Sebastián de Belalcázar in 1534 in spite of strenuous resistance by the indigenous tribes.

The area became part of the Viceroyalty of Peru, established in 1542. In 1718 it was annexed to the northern Viceroyalty of New Granada. It reverted to Peru in 1722, and then again to New Granada in 1739.

The move for independence began in 1809, but it did not succeed until Antonio José de Sucre, a lieutenant of Simón Bolívar, won the Battle of Pichincha in 1822. On May 24, 1822, Quito, as Ecuador then was known, became part of the republic of Greater Colombia, the president of which was Bolívar. Eight years later, Quito seceded from Greater Colombia and on May 30, 1830, became the Republic of Ecuador.

General Juan José Flores was the first president, 1830–45. President Gabriel García Moreno (1861–65 and 1869–75) of the Conservative party ruled as a dictator. He made the Roman Catholic Church the established church and made adherence to Roman Catholicism a requirement of citizenship. He also built schools and roads and made other improvements in the country. Following a revolution in 1895, the Liberal party took control. Its leader, President Eloy Afaro (1895–1901 and 1906–11), also ruled as a dictator. Under his regime, church and state were separated, foreign investment was attracted, and an extensive railway system was built.

Ecuador supported the Allies in World War II and became a member of the United Nations and of the Alliance for Progress. Meanwhile, social and economic progress was impeded by political instability caused by factional rivalry. There were frequent changes of government, but little violence. Seizure of power was commonly followed by free elections, and the deposed presidents were exiled rather than imprisoned.

José María Velasco Ibarra was a dominant figure in Ecuadoran politics, holding the office of president five times (1934–35, 1944–47, 1952–56, 1960–61, and 1968–70). He assumed dictatorial powers in 1970 and was overthrown two years later.

Meanwhile, substantial oil reserves were discovered in the interior in 1967, and United States corporations began to develop them by the early 1970's. Oil revenue brought a measure of prosperity to the country and a middle class began to develop. In 1979 a civilian government was elected under a new constitution that had taken effect that year.

During the early 1980's, several border clashes between Ecuador and Peru erupted in the interior over access to the Amazon River.

A decline in world oil prices during the 1980's severely weakened the economy. Each successive regime instituted austerity programs, such as price increases in fuel and other essential commodities, and caused widespread unrest. The country was beset by labor strikes, rioting, and terrorist bombings. After a 1995 border clash with Peru, regional powers encouraged a negotiated settlement and in 1998 an agreement was reached.