The first evidence of human settling in Costa Rica comes from around 10,000BC, more than 12,000 years ago. Between then and the colonial period, Costa Rica was home to at least 25 indigenous groups, each with its own culture and way of living. In 1502, the colonial period began as Christopher Columbus reached the eastern coast of Costa Rica.
Of all the Spanish colonies, Costa Rica enjoyed the least influence as a colony. Indeed, while Costa Rica holds its name “Rich Coast” because Columbus believed the land would be a large source of profits for Spain, it was initially a tough and unpopular place to settle, with few valuable or easily exploited resources. The Spanish were far more interested in developing their holdings in Mexico and Peru, where vast amounts of silver and gold were being obtained.
When Mexico rebelled against Spain in 1821, Costa Rica and the rest of Central America followed suit. At the time, Costa Rica, with other parts of Central America, briefly joined the Mexican Empire. In 1823 Costa Rica helped create and joined the Federal Republic of Central America with Guatemala, El Salvador, Honduras and Nicaragua. During its existence, the Federation faced many problems, and its disintegration began when Nicaragua separated from the federation in 1838, followed by Honduras and Costa Rica.
From the 1840s onwards, Costa Rican leaders quickly realized the potential of coffee cultivation and strove to promote coffee planting; a constant stream of oxcarts carried coffee from the Valle Central to Pacific ports and ships bound for Europe. The wealth generated by the export of coffee turned San Jose into a European-style city with boulevards and theaters.
In 1858 Costa Rica faced its first existential threat when US filibuster William Walker invaded Nicaragua and attempted to take over Costa Rica as well. However, he was defeated when he entered the country and after Walker, Costa Rica settled into comfortable obscurity, growing and exporting coffee, bananas, and pineapples.
By the late 19th century, bananas were beginning to rival coffee as the chief source of Costa Rican foreign exchange, especially after foreign investments were merged with others in 1899 to form the United Fruit Company, an American corporation that traded tropical fruits grown on Latin American plantations. While the United Fruit Company was a large multinational corporation with significant influence, particularly in Guatemala, Nicaragua and Costa Rica, the latter emerged as a state that resisted its role as "banana republic," by reducing poverty, improving education and laws, and protecting about one quarter of its land from development.
In 1948, the Costa Rican Civil War broke out, and it was a short, vicious affair that killed over 2,000 people over the course of 44 days.