Historians have classified the indigenous people of Costa Rica as belonging to the Intermediate Area, where the peripheries of the Mesoamerican and Andean native cultures overlapped. More recently, pre-Columbian Costa Rica has also been described as part of the Isthmo-Colombian Area.
Stone tools, the oldest evidence of human occupation in Costa Rica, are associated with the arrival of various groups of hunter-gatherers about 10,000 to 7,000 years BCE in the Turrialba Valley. The presence of Clovis culture type spearheads and arrows from South America opens the possibility that, in this area, two different cultures coexisted.
Agriculture became evident in the populations that lived in Costa Rica about 5,000 years ago. They mainly grew tubers and roots. For the first and second millennia BCE there were already settled farming communities. These were small and scattered, although the timing of the transition from hunting and gathering to agriculture as the main livelihood in the territory is still unknown.
The earliest use of pottery appears around 2,000 to 3,000 BCE. Shards of pots, cylindrical vases, platters, gourds and other forms of vases decorated with grooves, prints, and some modelled after animals have been found.
The impact of indigenous peoples on modern Costa Rican culture has been relatively small compared to other nations, since the country lacked a strong native civilization to begin with. Most of the native population was absorbed into the Spanish-speaking colonial society through inter-marriage, except for some small remnants, the most significant of which are the Bribri and Boruca tribes who still inhabit the mountains of the Cordillera de Talamanca, in the southeastern part of Costa Rica, near the frontier with Panama.
The name la costa rica, meaning "rich coast" in the Spanish language, was in some accounts first applied by Christopher Columbus, who sailed to the eastern shores of Costa Rica during his final voyage in 1502, and reported vast quantities of gold jewelry worn by natives. The name may also have come from conquistador Gil González Dávila, who landed on the west coast in 1522, encountered natives, and appropriated some of their gold.
During most of the colonial period, Costa Rica was the southernmost province of the Captaincy General of Guatemala, nominally part of the Viceroyalty of New Spain. In practice, the captaincy general was a largely autonomous entity within the Spanish Empire. Costa Rica's distance from the capital of the captaincy in Guatemala, its legal prohibition under Spanish law from trade with its southern neighbor Panama, then part of the Viceroyalty of New Granada (i.e. Colombia), and lack of resources such as gold and silver, made Costa Rica into a poor, isolated, and sparsely-inhabited region within the Spanish Empire. Costa Rica was described as "the poorest and most miserable Spanish colony in all America" by a Spanish governor in 1719.
Another important factor behind Costa Rica's poverty was the lack of a significant indigenous population available for encomienda (forced labor), which meant most of the Costa Rican settlers had to work on their own land, preventing the establishment of large haciendas (plantations). For all these reasons, Costa Rica was, by and large, unappreciated and overlooked by the Spanish Crown and left to develop on its own. The circumstances during this period are believed to have led to many of the idiosyncrasies for which Costa Rica has become known, while concomitantly setting the stage for Costa Rica's development as a more egalitarian society than the rest of its neighbors. Costa Rica became a "rural democracy" with no oppressed mestizo or indigenous class. It was not long before Spanish settlers turned to the hills, where they found rich volcanic soil and a milder climate than that of the lowlands.
Like the rest of Central America, Costa Rica never fought for independence from Spain. On 15 September 1821, after the final Spanish defeat in the Mexican War of Independence (1810–21), the authorities in Guatemala declared the independence of all of Central America. That date is still celebrated as Independence Day in Costa Rica even though, technically, under the Spanish Constitution of 1812 that had been readopted in 1820, Nicaragua and Costa Rica had become an autonomous province with its capital in León.
Upon independence, Costa Rican authorities faced the issue of officially deciding the future of the country. Two bands formed, the Imperialists, defended by Cartago and Heredia cities which were in favor of joining the Mexican Empire, and the Republicans, represented by the cities of San José and Alajuela who defended full independence. Because of the lack of agreement on these two possible outcomes, the first civil war of Costa Rica occurred. The Battle of Ochomogo took place on the Hill of Ochomogo, located in the Central Valley in 1823. The conflict was won by the Republicans and, as a consequence, the city of Cartago lost its status as the capital, which moved to San José.
In 1838, long after the Federal Republic of Central America ceased to function in practice, Costa Rica formally withdrew and proclaimed itself sovereign. The considerable distance and poor communication routes between Guatemala City and the Central Plateau, where most of the Costa Rican population lived then and still lives now, meant the local population had little allegiance to the federal government in Guatemala. From colonial times to now, Costa Rica's reluctance to become economically tied with the rest of Central America has been a major obstacle to efforts for greater regional integration.
Economic growth in the 19th century
Coffee was first planted in Costa Rica in 1808, and by the 1820s, it surpassed tobacco, sugar, and cacao as a primary export. Coffee production remained Costa Rica's principal source of wealth well into the 20th century, creating a wealthy class of growers, the so-called Coffee Barons. The revenue helped to modernize the country.
Most of the coffee exported was grown around the main centers of population in the Central Plateau and then transported by oxcart to the Pacific port of Puntarenas after the main road was built in 1846. By the mid-1850s the main market for coffee was Britain. It soon became a high priority to develop an effective transportation route from the Central Plateau to the Atlantic Ocean. For this purpose, in the 1870s, the Costa Rican government contracted with U.S. businessman Minor C. Keith to build a railroad from San José to the Caribbean port of Limón. Despite enormous difficulties with construction, disease, and financing, the railroad was completed in 1890.
Most Afro-Costa Ricans descend from Jamaican immigrants who worked in the construction of that railway and now make up about 3% of Costa Rica's population. U.S. convicts, Italians and Chinese immigrants also participated in the construction project. In exchange for completing the railroad, the Costa Rican government granted Keith large tracts of land and a lease on the train route, which he used to produce bananas and export them to the United States. As a result, bananas came to rival coffee as the principal Costa Rican export, while foreign-owned corporations (including the United Fruit Company later) began to hold a major role in the national economy and eventually became a symbol of the exploitative export economy. The major labor dispute between the peasants and the United Fruit Company (The Great Banana Strike) was a major event in the country's history and was an important step that would eventually lead to the formation of effective trade unions in Costa Rica, as the company was required to sign a collective agreement with its workers in 1938.
Historically, Costa Rica has generally enjoyed greater peace and more consistent political stability than many of its fellow Latin American nations. Since the late 19th century, however, Costa Rica has experienced two significant periods of violence. In 1917–19, General Federico Tinoco Granados ruled as a military dictator until he was overthrown and forced into exile. The unpopularity of Tinoco's regime led, after he was overthrown, to a considerable decline in the size, wealth, and political influence of the Costa Rican military. In 1948, José Figueres Ferrer led an armed uprising in the wake of a disputed presidential election between Rafael Ángel Calderón Guardia (who had been president between 1940 and 1944) and Otilio Ulate Blanco. With more than 2,000 dead, the resulting 44-day Costa Rican Civil War was the bloodiest event in Costa Rica during the 20th century.
The victorious rebels formed a government junta that abolished the military altogether, and oversaw the drafting of a new constitution by a democratically elected assembly. Having enacted these reforms, the junta transferred power to Ulate on 8 November 1949. After the coup d'état, Figueres became a national hero, winning the country's first democratic election under the new constitution in 1953. Since then, Costa Rica has held 14 presidential elections, the latest in 2018. With uninterrupted democracy dating back to at least 1948, the country is the region's most stable.