Human verified. Last updated by our editorial team on .
Central America · Independence and the federations
Costa Rica
1821/1838–present
Costa Rica is the small Central American republic that turned a marginal colonial province into one of the most stable and least militarised states in the western hemisphere. It occupies about 51,100 square kilometres between Nicaragua and Panama, most of its people live in the high volcanic basin around San José, and it has no standing army. Its independence was declared in Guatemala City in 1821, its separation from the Central American federation came in 1838, and its existence as a republic dates from 1848. For most of the nineteenth century it was a coffee exporter with a very thin state; for most of the twentieth it was a welfare democracy built on that coffee, on bananas, and after 1948 on the decision not to spend money on soldiers.
- Existed
- 1821/1838–present
- Shown on the map
- 1840–present
- Peak area
- 56k km²
- Region
- Central America
The country matters out of proportion to its size for three reasons. It is the clearest case in Latin America of a republic that disarmed itself and then prospered, and the 1948 civil war that produced that decision was the bloodiest event in its modern history: roughly 2,000 dead in six weeks. It is also the clearest case of a political system that converted an export crop into public schools, and then converted public schools into an electronics and medical-device economy. And it is the country that broke the Central American wars of the 1980s, not by force but by drafting a peace plan that five presidents signed in 1987.
It is not, however, the placid democracy of its own national mythology. Costa Rica had a dictatorship in 1917–19, a disputed election and a civil war in 1948, and a nineteenth century in which four towns fought for the capital and the state sold off communal land to pay for coffee. Its famous absence of an army is a constitutional prohibition written by the victors of that civil war, not an ancient national custom. And the "white, egalitarian peasant republic" that Costa Rican schoolbooks described for a century was a liberal invention of the 1880s, built on the labour of people the same state was busy dispossessing.
The map draws Costa Rica from 1840, which is two years after the separation from the federation and eight years before the republic was proclaimed. The dates below therefore run wider than the drawn range: the independence of 1821, the Ochomogo war of 1823 and the federal decades of 1824–38 all sit outside it.
At a glance
| Name | Estado Libre de Costa Rica (1838–48); República de Costa Rica (1848–present) |
| Dates | Independence from Spain proclaimed 15 September 1821; separate from the Central American federation 14 November 1838; republic 31 August 1848. The map draws 1840–2024 |
| Where | The Central Valley (Meseta Central) between the volcanic cordilleras, the Nicoya peninsula and Guanacaste to the north-west, the Caribbean lowlands around Limón, and the southern Pacific coast; 51,100 km², with Nicaragua to the north and Panama to the south-east |
| Capital | Cartago until 1823, then San José, confirmed by the war of 1835 and by decree in 1837 |
| Government | Unitary presidential republic; the constitution of 1949, with a Supreme Electoral Tribunal since 1949 and no standing army since 1948 |
| Population | About 50,000 in 1801; 120,499 at the first census in 1864; 471,524 in 1927; 5,044,197 at the census of 2022 |
| Economy and language | Coffee from the 1830s, bananas from the 1880s, then tourism, electronics, corporate services and medical devices; Spanish official, with an English-speaking Afro-Caribbean population in Limón |
| Religion | Roman Catholic, named the religion of the state in article 75 of the 1949 constitution, with freedom of worship guaranteed |
| End | None; the republic continues, and the map's last drawn year is 2024 |
Why did such a poor province become a state?
Because it had almost nothing the Spanish crown wanted, and that turned out to be an advantage. Costa Rica was the southernmost province of the Captaincy General of Guatemala, administered from Cartago, founded in 1563 by Juan Vázquez de Coronado. Columbus had touched the Caribbean coast in 1502, but the conquest proper took most of the sixteenth century and produced no mines, no dense tribute population within reach of the capital, and no great encomienda fortunes. The indigenous population collapsed from about 120,000 in 1569 to some 10,000 by 1611, killed by disease, war and forced labour; the survivors retreated into the Talamanca ranges. Spanish settlers who wanted labour did not find it, and those who stayed farmed their own land.
The result was a society of small and medium landowners, maize and beans on the basin floors, cattle on the Guanacaste plains, and a good deal of local autonomy because the authorities in Guatemala City were far away and uninterested. Costa Rica was poor in the specific sense that it had no export that anyone wanted to buy: cacao from Matina on the Caribbean coast went out to Cartago and beyond, and a tobacco factory given to San José in 1784 made that town the commercial centre of the province, but neither produced revenue on the scale of indigo in El Salvador or cochineal in Oaxaca. Eighteenth-century governors complained of their own poverty, and the province's notables governed through municipal cabildos rather than through a colonial bureaucracy.
That structure mattered after independence. There was no criollo aristocracy with great estates to defend, no mining interest, no large enslaved workforce, and no strong tradition of forced indigenous labour in the Central Valley. What there was instead were four rival towns — Cartago, the old capital; San José, the commercial town; Heredia and Alajuela, the farming towns — each with its own cabildo, its own militia and its own leading families. Costa Rican politics for the next half-century was largely the quarrel between those four, and the shape of the modern state was settled by which of them won.
Costa Rica was also, in the terms of the wider empire, a frontier. Its Caribbean coast faced the Miskito kingdom and British traders at Bluefields and Greytown; its southern border with Gran Colombia and later with Panama was undefined; and the Nicoya peninsula to the north-west belonged administratively to Nicaragua. The country that emerged after 1821 was therefore not an obvious unit at all, but a province with unusually clear internal boundaries and unusually weak external ones.

How did independence arrive in 1821?
It arrived by post, from Guatemala City, and it was not at first clear what it meant. The Act of Independence of Central America was signed on 15 September 1821 by the provincial authorities in Guatemala, following the collapse of Spanish royal government in Mexico. The documents reached Cartago on 13 October, and a hastily convened meeting of the province's leading men adopted a formula that has stayed in Costa Rican memory: independence was acknowledged, but final decisions would wait "until the clouds of the day clear". A junta of delegates from the four towns took power, and on 1 December 1821 it issued the Pacto de Concordia, the province's first constitutional text, which asserted the right of Costa Rica to constitute its own government, proclaimed freedom of trade and — fatally — made the capital rotate among the four towns.
Three options were on the table. One was union with the new Mexican Empire of Agustín de Iturbide, which had absorbed the Central American provinces in 1822 and which had supporters in Cartago, among the clergy and among families who expected a monarchy to protect the privileges they had held under Spain. One was incorporation into the United Provinces of Central America, the federation proclaimed in Guatemala in 1823. One was association with Gran Colombia, which had a certain appeal in a province with more trade with Panama and the Pacific than with Guatemala. A rising in Cartago in February 1823, in which radicals demanded union with Colombia, showed how fluid the alignments were.
The Cartago cabildo had in fact declared the province's adhesion to the Mexican Empire in December 1821, and the imperial option gained armed force in March 1823 when conservatives in Cartago, backed by Heredia, seized the Cartago barracks and proclaimed union with Mexico. San José and Alajuela refused. They raised a militia under Gregorio José Ramírez, a merchant and shipmaster from Alajuela, and marched on Cartago.
Why did the battle of Ochomogo decide the capital?
Because it settled which town would govern, even though the question it was fought over had already been answered elsewhere. The two forces met on 5 April 1823 at the Ochomogo pass, the gap in the mountains between the Pacific and Caribbean watersheds that separates San José from Cartago. The battle lasted a few hours, was fought with muskets from behind volcanic rocks and with the few guns the Cartago militia had inherited from Spain, and killed about twenty people. Ramírez's men broke the Cartago line, entered the city and disarmed it. Heredia's militia, meanwhile, had invaded Alajuela; the republicans turned back and recovered it.
Ramírez governed for ten days, issued two decrees — one moving the capital to San José, one convening an elected governing council — and handed power back. By then news had arrived that Iturbide had abdicated on 19 March, so the imperial question that had caused the war no longer existed. The battle is therefore often described, correctly, as unnecessary in its own terms and decisive in its consequences: the commercial town beat the administrative town, the liberals beat the conservatives, and San José kept the government.
Keeping it took another twelve years. The four cities agreed in 1834 to the Ley de la Ambulancia, which rotated the capital among them, beginning with Alajuela; the experiment lasted barely a year and produced a government that could not function. When Braulio Carrillo abolished the rotation in 1835, Cartago, Heredia and Alajuela went to war — the Guerra de la Liga of September and October 1835 — and lost. San José's victory was made permanent by decree in 1837. The pattern was set early: Costa Rican politics was decided by control of the Central Valley's towns, and the winner did not share.
What did membership of the Central American federation give and cost?
It gave Costa Rica a legal framework, a brief external shield, and very little else. The province sent deputies to the federal congress, though as the least populous state it was entitled to only two of them, against eighteen for Guatemala; it took its seats in 1824, the last state to join. In January 1825 its own constituent congress issued the Ley Fundamental del Estado Libre de Costa Rica, which declared the state independent of Spain, Mexico and any other power while uniting it to the Federal Republic of Central America, divided government into four branches, set a property qualification of 100 pesos for electors, made Catholicism the state religion and created a bishopric independent of Nicaragua's.
In practice Costa Rica ran its own affairs. It minted its own coinage from 1825 and opened a Casa de Moneda in 1828; it had its own head of state, legislature and supreme court by the end of 1825. In 1828, while the federation tore itself apart in a civil war between Guatemala and El Salvador, the Costa Rican congress passed the Ley Aprilia, declaring that the state assumed its own sovereignty without leaving the union. The pattern of the next decade was set: formal membership, practical autonomy, and a growing conviction among the men who ran San José that the federation was a source of debt and wars rather than of security.
The one clear gain was territorial. On 25 July 1824 the cabildos of Nicoya and Santa Cruz voted to join Costa Rica rather than Nicaragua; the federal congress ratified the annexation on 18 March 1825 and added the town of Guanacaste, now Liberia, which had voted against. That acquisition — the "Partido de Nicoya", later the province of Guanacaste — gave Costa Rica its cattle plains, its driest climate and its largest single territorial addition. It also created a border dispute with Nicaragua that was not settled until the Cañas-Jerez treaty of 1858 and the Cleveland arbitration of 1888, and which surfaced again at the International Court of Justice in the twenty-first century.
The costs were financial and political. Costa Rica assumed a share of the federation's foreign debt, contracted in London in 1824, and spent years trying to establish what it owed. It had no say in the federation's wars. And in 1836 Colombia occupied Bocas del Toro, territory Costa Rica claimed on the Caribbean coast, without any federal response — an argument that Carrillo used repeatedly when he decided to leave.
How did Carrillo make a state and leave the union?
By concentrating power in San José and selling land to coffee. Braulio Carrillo Colina, a lawyer who had been a federal deputy, governed from 1835 to 1837 and again from 1838 to 1842, and his second administration was a dictatorship in the straightforward sense: he suspended the constitution, ruled by decree and declared himself irremovable. He also did more than any other nineteenth-century figure to make Costa Rica a state. He abolished the rotating capital, suppressed the municipalities, reorganised the country into five departments, issued the first civil, criminal and procedural codes, created the first customs tariff and a general treasury regulation, and built a road from Paraíso to Moín on the Caribbean so that coffee could reach the Atlantic without crossing Nicaraguan territory.
On 14 November 1838 he declared Costa Rica separated from the federation, and the Ley de Bases y Garantías of 1841 — the constitution he wrote for himself — opened with the state's sovereignty and independence. The timing was not ideal: the federal congress had effectively dissolved itself in May 1838, Nicaragua had gone in April and Honduras would follow in October. But Carrillo's separation was the one that stuck, because Costa Rica had revenue, a port, and no federal army to fear. His land policy was the other half of the programme: land was privatised, vagrancy was criminalised, and settlers who planted coffee on unused land could claim it. That combination — secure property, forced labour discipline, and a crop with a European market — is what made the coffee economy possible.
His fall came from outside. Francisco Morazán, the Honduran general who had led the federation, landed at Caldera in April 1842 with 500 Salvadoran troops to use Costa Rica as a base for reconquering Central America. Carrillo's own commander changed sides at El Jocote, Carrillo fled to El Salvador, and Morazán took power. He restored the 1825 constitution, levied forced loans, and within months faced revolts in Alajuela and San José. On 15 September 1842 he was captured in Cartago, tried in a few hours and shot in what is now the central park of San José. Antonio Pinto Soares, a Portuguese-born officer, took over briefly; the assembly then chose José María Alfaro. Carrillo was murdered in exile in 1845.
How did coffee remake the country?
Slowly, then completely. Coffee reached Costa Rica at the end of the eighteenth century — the earliest record is a consignment of two pounds sent from Panama to the governor in 1791 — and from 1808 Governor Tomás de Acosta promoted its cultivation on the volcanic soils of the Central Valley. The first planter of record was the priest Félix Velarde, who planted a plot in 1816 and left his seed to his neighbours. The first export was a single quintal shipped from Puntarenas to Panama in 1820. In 1832 the German merchant George Stiepel sold a cargo to England through Chile, and in 1841 or 1843 — Costa Rican accounts differ, and the English ones usually give the later date — the Guernsey shipowner William Le Lacheur brought the Monarch to Puntarenas and carried 5,505 quintals directly to London for the planter Santiago Fernández Hidalgo. Direct trade with the British market had begun.
The effects were rapid. Coffee was exempted from the tithe in 1825; from 1831 anyone who cultivated it for five years on unused land could claim the land; the road to Puntarenas was finished in 1846. By 1850 coffee was about 90 per cent of Costa Rica's exports, a share it held for four decades. The crop suited the Central Valley: small and medium farms could grow it, process it on a hand-powered mill and sell it to a merchant house in San José, and a class of smallholders grew up alongside the great exporters. But it also concentrated wealth and, more importantly, it concentrated land. The privatisation of communal and "vacant" land in the 1830s and 1840s pushed peasant families onto the margins and drove the remaining Indigenous communities of the Central Valley into the mountains, above all into Talamanca.
The men who financed the trade became the country's ruling class. Export houses advanced credit against the next harvest, imported manufactured goods on the return voyage, and connected the growers to London and Hamburg. Juan Rafael Mora Porras, who became head of state in 1849, was one of them. The state that coffee built was small, cheap and oligarchic: a customs house, a court, a few schools, a militia, and a great deal of deference to the families who controlled the export trade. The oxcart, with its spoked wheels and painted panels, became the national symbol of that economy because it was what actually carried the crop down to the Pacific.
When did the republic begin, and what did 1848 change?
On 31 August 1848, when a constituent congress adopted a constitution that declared Costa Rica a sovereign republic, independent of any other state, and gave its head of state the title of president. The author of the change was José María Castro Madriz, a 28-year-old lawyer who had founded the University of Santo Tomás in 1843 and who became the country's first president and its youngest. The new flag — tricolour, designed by his wife Pacífica Fernández Oreamuno after the French model — and the new coat of arms were decreed on 29 September and the flag was flown for the first time on 12 November 1848.
The date is often given as 1847, and the confusion is understandable. The constitution of 1847 had already renamed the country "State of Costa Rica" and created the office of President of the State, and some accounts treat that as the founding of the republic. But the formal proclamation of the República de Costa Rica, with the title and the symbols, belongs to 1848. What changed in practice was less the name than the machinery: the 1848 constitution strengthened the executive against the legislature, and it also narrowed the franchise by raising property qualifications, which is why Castro Madriz spent his short presidency putting down conspiracies and why the army pushed him out in 1849.
The republic's first great test was external. In 1856 the American filibuster William Walker, who had seized power in Nicaragua, announced plans to extend his rule south and reopened the question of slavery in the region. Costa Rica declared war, mobilised some 10,000 men, and defeated a Walker advance at Santa Rosa in Guanacaste on 20 March 1856. On 11 April, at Rivas in Nicaragua, Costa Rican troops held the town against Walker's main force; the Alajuela drummer Juan Santamaría is remembered for setting fire to the building where the filibusters had taken cover, and died doing it. Cholera then broke out in the army, and the retreat home carried the disease across the country. About 10,000 people died, close to a tenth of the population, and the war cost more lives than it settled questions.
What did the liberal order of 1871 build, and whom did it exclude?
It built a secular state, a school system and a railway, and it excluded the Church, the poor and the Black workers who laid the track. Tomás Guardia Gutiérrez seized power in April 1870 and governed, with a brief interval, until 1882. His constitution of 1871 abolished the death penalty, guaranteed freedom of worship and of the press, and separated the branches of government; it remained in force, with interruptions, until 1949, the longest run of any Costa Rican constitution. Guardia also began the Atlantic railway, contracted in 1871 and completed only in 1890, and it was that railway that brought the banana economy and the Afro-Caribbean workforce, recruited above all in Jamaica, to Limón.
The liberal programme proper came from the generation that followed him, the writers and officials known as the Olimpo. Under Próspero Fernández (1882–85) and Bernardo Soto (1885–89) the state expelled the bishop Bernardo Augusto Thiel and the Jesuits in 1884, secularised the cemeteries, abolished the Concordat, banned monastic orders and restricted processions. Under Mauro Fernández Acuña, Soto's education minister, primary schooling was made free, compulsory and secular, the University of Santo Tomás was closed in 1886 as unsuited to modern science, and a national system of lyceums and normal schools was created. Literacy rose; so did the state's ambition to shape how people lived.
That programme had a racial politics. The liberal elite described Costa Rica as a white, hard-working, property-owning nation, distinct from the republics around it, which they described as barbarous — a claim that sat awkwardly with a mestizo population, with the Black Protestant workers of Limón, and with the fact that the national patroness was a Black Virgin and the national hero a mulatto drummer boy. The state resolved the contradiction by making the Campaña Nacional of 1856 the founding myth of the nation and by casting Juan Santamaría and Juan Rafael Mora as its martyrs. The myth worked, and it is still working; it is one of the reasons Costa Ricans describe their country as European when it is not.
The liberal order's political record was mixed. In 1889 the outgoing president tried to impose his candidate; the opposition won, the crowd took to the streets on 7 November, and Soto stepped aside rather than shoot. That day is conventionally treated as the beginning of Costa Rican democracy, though the system that followed was oligarchic, clientelist and restricted, and it produced a dictatorship in 1917, when Federico Tinoco overthrew Alfredo González Flores after González had created a state bank and taxed the coffee elite. Tinoco ruled for two years, was not recognised by the United States, and fell in 1919 after students and teachers protested a cut in schoolteachers' pay. In 1921 Costa Rica fought a brief border war with Panama over the Coto region, settled by arbitration by the United States in 1923.
How did the reforms of the 1940s lead to civil war?
Because they were pushed through by an alliance that its opponents regarded as illegitimate, and because the election of 1948 gave those opponents the chance to say so. The Depression broke the liberal order's legitimacy: the coffee and banana economy collapsed, unemployment rose, and the Communist Party, founded in 1931 and led by Manuel Mora Valverde, organised the banana workers' strike of 1934 on the Caribbean coast. When Rafael Ángel Calderón Guardia won the presidency in 1940, he answered the challenge from the left with a social programme from the right: the University of Costa Rica was founded in 1940, the Caja Costarricense de Seguro Social in 1941, social guarantees were written into the constitution in 1942, and a labour code followed in 1943, drafted with the help of the Church and, in effect, of the Communists.
The coalition that carried this through was strange and unstable. Calderón was a Catholic physician who had campaigned with the support of the Archbishop Víctor Manuel Sanabria; he governed with the votes of Mora's Vanguardia Popular, which gave him a congressional majority, and with the acquiescence of the Church, which got religious instruction back in the schools. The coffee and commercial elite, which had supported him in 1940, abandoned him when he taxed their capital and interned German and Italian residents during the war. His successor Teodoro Picado (1944–48) governed with the same coalition, in an atmosphere of armed party militias, street violence and mutual accusation.
The 1948 election was between Calderón and Otilio Ulate, a journalist and publisher. To reassure the opposition, Picado placed it under an independent electoral tribunal for the first time; Ulate won, and the tribunal certified the result by two votes to one. On 1 March the legislature, where Calderón's party and the Communists had a majority, annulled the election. That afternoon the police killed Carlos Luis Valverde, Ulate's campaign manager, on his doorstep. On 12 March José Figueres Ferrer, a coffee farmer and businessman who had been exiled in 1942 after a radio broadcast against Calderón, led an armed rising from the south under the banner of the National Liberation Army.
The war lasted six weeks and killed about 2,000 people. Figueres's forces worked north along the Pan-American Highway, took Cartago on 12 April, and stopped short of San José, where Mora's Communist militia had fortified the capital. Picado resigned on 20 April after signing the Pact of the Mexican Embassy, which guaranteed the safety of his supporters; he and Calderón went into exile in Nicaragua. On 24 April the rebels entered San José, and on 8 May a provisional junta under Figueres took power.
What did 1948 settle?
It settled that the army would go, that the banks would belong to the state, and that the 1949 constitution would be written by the winners. The junta ruled by decree for eighteen months. It nationalised the banks, imposed a 10 per cent levy on capital, created the Costa Rican Institute of Electricity, and on 1 December 1948 abolished the army at a ceremony in the Bellavista barracks, which became a museum. Article 12 of the constitution of 1949 then wrote the decision into fundamental law: "The Army is proscribed as a permanent institution"; police forces would keep public order, and military forces could be organised only under a continental agreement or for national defence, always subordinate to civilian power.
The constitution of 7 November 1949 is the country's standing charter. It created the Supreme Electoral Tribunal as a fourth branch of government with sole authority over elections, gave women the vote and extended citizenship to Costa Ricans of African descent born in the country, guaranteed free and compulsory primary education, and set up the autonomous institutions — the social security fund, the electricity institute, the banks — that now spend a large share of the budget. Figueres handed power to Ulate on 8 November 1949, as he had promised, and then won the presidency himself in 1953. His party, the Partido Liberación Nacional, founded in 1951, and the Social Christian coalition that formed around Calderón's heirs alternated in power for the rest of the century.
The settlement was neither as bloodless nor as consensual as it later looked. The junta jailed and exiled Calderonistas and Communists, and a 1949 coup attempt and a 1955 invasion from Nicaragua by Calderón's supporters were both defeated. The 1949 constitution preserved the Catholic Church's official status while guaranteeing worship, and it left intact an export economy owned by the same families, now protected by state banks and a coffee quota. What it did do, decisively, was remove the institution that had made and unmade governments since 1823, and redirect its budget into schools, clinics and roads. Costa Rica did not become a democracy because it abolished the army; it abolished the army because its democracy had just survived an attempt to overturn an election.
How did a country without an army survive the Cold War?
Partly by making its defencelessness a foreign policy, and partly by luck. Costa Rica broke relations with Cuba in 1961 and joined the Central American Common Market in 1963, which deepened industrialisation behind a regional tariff wall. It stayed out of the Central American wars of the 1970s and 1980s even as they reached its borders. In 1983 President Luis Alberto Monge proclaimed Costa Rica's neutrality — perpetual, active and unarmed — a formula designed to keep the country out of the American campaign against the Sandinista government in Nicaragua, and Arias's government after 1986 refused permission for the United States to use Costa Rican territory to supply the Contras.
The peace plan that made the country famous was not a single-handed achievement, though the Nobel committee's citation in 1987 was for one man. The Contadora Group of Colombia, Mexico, Panama and Venezuela had been working on a regional settlement since 1983; the Esquipulas meeting of Central American presidents in May 1986 had produced a first framework; and the Guatemalan president Vinicio Cerezo circulated a draft that drew on all of it. Arias's own proposal, presented in February 1987, became the working text. The Procedure for the Establishment of a Firm and Lasting Peace in Central America — Esquipulas II — was signed by the five presidents in Guatemala City on 7 August 1987, and committed them to national reconciliation, free elections, an end to aid for irregular forces and international verification.
Arias received the Nobel Peace Prize that October. The plan did not end the wars by itself; the Nicaraguan conflict ran until 1990, and the Salvadoran one until 1992. But it created the framework in which those endings were negotiated, and it gave Costa Rica a diplomatic identity that outlasted the crisis: a small state that mediated rather than fought. The country's subsequent disputes with Nicaragua — over the San Juan river, over navigational rights, over a strip of wetland at Isla Portillos — were taken to the International Court of Justice rather than to arms. The Court found in 2015 that Nicaragua had violated Costa Rican territory, and in 2018 settled the maritime boundaries and the status of the northern Isla Portillos.
Who pays for the green republic?
The coffee and banana economy that financed the welfare state ran out of road in the 1970s and 1980s. Costa Rica borrowed heavily against oil shocks and falling coffee prices, and in 1981–82 it defaulted, devalued and went to the International Monetary Fund, which imposed the structural adjustment that the rest of Latin America also endured. What came next was a deliberate diversification. The national park system, begun in the 1970s, was expanded until about a quarter of the national territory was under some form of protection; the forestry law of 1996 created a payment-for-environmental-services scheme that pays landowners for watershed protection and biodiversity. Tourism followed the parks. In 1997 Intel opened a microprocessor plant in Heredia, which at its peak accounted for a fifth of Costa Rica's exports and nearly 5 per cent of GDP; when Intel closed its manufacturing line in 2014, it kept a test and design centre, and the free-trade zones had already attracted medical device makers, corporate service centres and pharmaceutical plants.
The results are visible in the export basket. Medical devices reached US$8.675 billion in 2024, about 48 per cent of goods exports, and Costa Rica has become one of the largest exporters of the sector in the world relative to its population. Tourism, which fell from 3.14 million arrivals in 2019 to 1.01 million in 2020, recovered to 2.94 million in 2025 — still short of the pre-pandemic peak. In 2007 Costa Rica became the first country to approve the Central America–Dominican Republic free trade agreement with the United States by referendum, 51.6 per cent to 48.4 per cent with 40 per cent abstention; it entered into force in 2009. In 2021 the country became the 38th member of the OECD, the first in Central America.
The bill for all this is now the central political question. Public debt rose above 60 per cent of GDP by the late 2010s, and the fiscal reform of 2018 — a value-added tax, a spending rule and new rules on public-sector pay — was passed only after a general strike. Inequality is high by the standards of the developed world, poverty affects about a fifth of households, and the social insurance system that Calderón built runs a deficit. The paradox is that the country's greatest assets, its schools and its clinics, are also its most expensive commitments, and its tax take has historically been among the lowest in the OECD. Rodrigo Chaves, president from 2022, campaigned against the political class and governed with a confrontational style; in February 2026 the electorate gave Laura Fernández an outright first-round victory. The republic that abolished its army to pay for schools is now arguing about how to keep paying for them.
Common myths about Costa Rica
| Myth | What the evidence says |
|---|---|
| Costa Rica was a poor but egalitarian colony of small farmers, with no aristocracy and no slavery | There were enslaved Africans in the colonial province, and slavery was abolished only on 17 April 1824, by decree of the federal congress. The "peasant republic" was a nineteenth-century liberal description of a society that was already stratified by land, and the coffee boom of the 1830s–50s made it more so |
| Coffee arrived with independence, as a gift of the new republic | Coffee was recorded in Costa Rica in 1791; cultivation was promoted from 1808; the first planter of record dates from 1816; the first export, one quintal to Panama, from 1820 — all before the coffee boom of the 1830s |
| Costa Rica has been a democracy without interruption since independence | There was a dictatorship under Braulio Carrillo (1838–42), a coup in 1917 and the Tinoco dictatorship until 1919, and a civil war in 1948 followed by eighteen months of rule by decree |
| Costa Rica abolished its army out of pacifist conviction | The junta abolished the army on 1 December 1948, four months after a civil war in which the army had backed the losing government. Article 12 of the 1949 constitution permits military forces under a continental agreement or for national defence |
| The 1948 war was a straight fight between communism and democracy | The government side was a coalition of Calderón's social Catholics and Mora's Communists; the rebel side mixed social democrats, conservatives and anti-communists. Somoza's Nicaragua helped the government, Guatemala's reformist government sympathised with Figueres, and the United States tilted towards him |
| Esquipulas II was Óscar Arias's plan, and he wrote it alone | It built on the Contadora process from 1983, on the Esquipulas declaration of 1986 and on a draft by President Cerezo of Guatemala. Arias's February 1987 proposal became the working text, and five presidents signed the agreement on 7 August 1987 |
| Guanacaste was taken from Nicaragua by force | The cabildos of Nicoya and Santa Cruz voted for annexation to Costa Rica on 25 July 1824, and the federal congress ratified it on 18 March 1825. Nicaragua protested repeatedly and the boundary was settled only by the Cañas-Jerez treaty of 1858 and the Cleveland award of 1888 |
| Costa Rica's tourism has fully recovered from the pandemic | Arrivals were 3,139,008 in 2019, 1,011,912 in 2020 and 2,943,991 in 2025 — about 94 per cent of the pre-pandemic figure, not above it |
| The country has no military forces at all | It has no army, but it has substantial police forces, including a border police and a coastguard, and the constitution contemplates the creation of military forces in specified circumstances |
Timeline of the Republic of Costa Rica
| Year | Event |
|---|---|
| 1821 | Independence from Spain proclaimed in Guatemala on 15 September; Costa Rica adheres on 13 October; Pacto de Concordia in December |
| 1823 | Battle of Ochomogo on 5 April; San José becomes the capital; the Mexican Empire has already fallen |
| 1824 | Costa Rica joins the Central American federation; Nicoya and Santa Cruz vote for annexation on 25 July; slavery abolished on 17 April |
| 1838 | Costa Rica separates from the federation, 14 November |
| 1841 | Ley de Bases y Garantías: Carrillo's authoritarian constitution |
| 1842 | Morazán lands at Caldera, takes power, and is shot in San José on 15 September |
| 1848 | Republic proclaimed on 31 August; new flag and coat of arms |
| 1856 | William Walker's filibusters defeated at Santa Rosa (20 March) and Rivas (11 April); cholera kills about 10,000 |
| 1871 | Constitution of 1871 under Tomás Guardia: death penalty abolished, press and worship freed |
| 1884–86 | Anticlerical laws; Bishop Thiel expelled; free, compulsory, secular primary education |
| 1889 | Popular rising of 7 November forces the government to accept the election result |
| 1890 | Atlantic railway completed; banana exports and Afro-Caribbean settlement in Limón |
| 1917–19 | Tinoco dictatorship; falls after protests over cuts to teachers' pay |
| 1940–43 | University of Costa Rica, social security fund, constitutional social guarantees, labour code |
| 1948 | Civil war, 12 March – 24 April, about 2,000 dead; army abolished on 1 December |
| 1949 | Constitution of 7 November: Supreme Electoral Tribunal, women's suffrage, no permanent army |
| 1983 | Proclamation of perpetual, active and unarmed neutrality, 17 November |
| 1987 | Esquipulas II signed on 7 August; Arias awarded the Nobel Peace Prize |
| 2007 | CAFTA-DR approved by referendum, 51.6 per cent to 48.4 per cent |
| 2021 | Costa Rica becomes the 38th member of the OECD |
What the map shows next
At 1848 on the map the map shows Costa Rica as a small independent republic with a coffee economy, a capital fixed at San José, and a northern boundary with Nicaragua that had not yet been settled: the Cañas-Jerez treaty was ten years away and the Cleveland award forty. It is worth comparing that shape with the federal outline of the 1830s, when Costa Rica was one of five states in a union that had already stopped functioning.
At 1948 on the map the country is at the moment of the civil war, with the coffee and banana economy at its height and the welfare state barely eight years old. At 2000 on the map the same territory carries a very different economy: national parks, foreign-owned electronics plants, and a tourist industry that was about to overtake coffee and bananas in foreign exchange.
Common questions
- When did Costa Rica become independent?
- Independence from Spain was proclaimed in Guatemala on 15 September 1821 and acknowledged in Cartago on 13 October, but Costa Rica remained part of the Central American federation until 14 November 1838, and was proclaimed a republic on 31 August 1848.
- Why is San José the capital and not Cartago?
- Because San José's republicans won the battle of Ochomogo on 5 April 1823, moved the government there, and confirmed the choice by force in the war of 1835 and by decree in 1837.
- Did Costa Rica fight a civil war?
- Yes, in 1948: a six-week war between the government of Teodoro Picado and the National Liberation Army of José Figueres killed about 2,000 people, the deadliest event in the country's modern history.
- Why does Costa Rica have no army?
- The victorious junta abolished the army on 1 December 1948, and article 12 of the 1949 constitution proscribed it as a permanent institution, allowing military forces only under a continental agreement or for national defence.
- Was Costa Rica ever a dictatorship?
- Yes — Braulio Carrillo ruled by decree from 1838 to 1842, and Federico Tinoco seized power in 1917 and governed until 1919 without international recognition.
- How did coffee get to Costa Rica?
- Coffee was recorded there in 1791, was actively promoted from 1808, and became the country's main export in the 1830s–40s, reaching about 90 per cent of exports by 1850.
- What was Esquipulas II?
- The peace agreement signed by the five Central American presidents in Guatemala City on 7 August 1987, based on a plan by President Óscar Arias of Costa Rica, which set out free elections, national reconciliation and an end to outside support for irregular forces.
- Did Costa Rica fight William Walker?
- Yes: Costa Rica declared war on Walker's regime in 1856, defeated his forces at Santa Rosa and Rivas, and lost about a tenth of its population to cholera brought back by the army.
- Is Costa Rica a member of the OECD?
- Yes, since 25 May 2021, when it became the organisation's 38th member and the first in Central America.
- What is Costa Rica's economy based on now?
- Medical devices, which were about 48 per cent of goods exports in 2024, along with tourism, corporate services, electronics and the traditional coffee and banana trade.
Sources
Every source below was consulted while writing this entry.
- Constitución Política de la República de Costa Rica, 1949, consolidated text (Tribunal Supremo de Elecciones, San José).
- Instituto Costarricense de Turismo, Anuario Estadístico de Turismo 2025 (San José, 2026).
- PROCOMER, The World's Health Is Made in Costa Rica (San José, December 2025).
- Nobel Prize Outreach, "Oscar Arias Sánchez – Facts", Nobel Peace Prize 1987.
- United Nations Peacemaker, Procedure for the Establishment of a Firm and Lasting Peace in Central America (Esquipulas II), Guatemala City, 7 August 1987.
- International Court of Justice, Certain Activities carried out by Nicaragua in the Border Area (Costa Rica v. Nicaragua), case 150.
- International Court of Justice, Maritime Delimitation in the Caribbean Sea and the Pacific Ocean (Costa Rica v. Nicaragua), case 157, judgment of 2 February 2018.
- UNESCO World Heritage Centre, Precolumbian Chiefdom Settlements with Stone Spheres of the Diquís, site 1453.
- US Department of State, "Welcoming Costa Rica to the OECD", press statement, 25 May 2021.
- Ciska Raventós Vorst, "Democracia directa en Costa Rica: el referendo sobre el TLC", in Anuario de Derecho Constitucional Latinoamericano (UNAM, 2009).
Data sources for the map
- Cliopatria v0.12 (Seshat Global History Databank, CC BY 4.0).
- Historical Basemaps (GPL-3.0).
This entry was written from the sources above and last updated .
Text available under CC BY-SA 4.0: reuse it with a credit to The World Through Time and a link to this page.
Border geometry for the map itself comes from Cliopatria v0.12 (Seshat Global History Databank, CC-BY-4.0).
See Costa Rica in its world
Open the atlas at 1932 and every neighbour, rival and successor is on screen with it — then drag the slider and watch what happens next.
Open the map at 1932 →