A chronology of key events:
1502 - Christopher Columbus visits the area, naming it Costa Rica, (Rich Coast), but disease and resistance by the local population delay the establishment of a permanent settlement for nearly 60 years.
San Jose grew rapidly in the 20th century
1736: Founded as Villa Nueva
1823: Became capital city
Population (metro area): 1.5 million
1540 onwards - Costa Rica is part of the vice-royalty of New Spain.
1561 - Spain's Juan de Cavallon leads the first successful colonisers into Costa Rica.
1808 - Coffee is introduced into Costa Rica from Cuba and becomes the principal crop.
1821 - Central America gains independence from Spain. A dispute ensues over whether Costa Rica should join an independent Mexico or a confederation of Central American states.
1823 - Costa Rica joins the United Provinces of Central America, which also embraces El Salvador, Guatemala, Honduras and Nicaragua.
1838 - Costa Rica becomes fully independent.
1849-59 - Under the leadership of Juan Rafael Mora, Costa Rica takes the lead in organising Central American resistance against William Walker, the US adventurer who took over Nicaragua in 1855.
1859 - Mora ousted in a bloodless coup.
1870-82 - Under the leadership of Tomas Guardia Costa Rica encourages intensive foreign investment in railways.
1874 - US businessman Minor Cooper Keith introduces banana cultivation and starts the United Fruit Company.
1917 - Frederico Tinoco ousts the elected president, Alfredo Gonzalez, but is himself deposed two years later.
Socialism and civil war
1940-44 - President Rafael Angel Calderon Guradia, founder of the United Christian Socialist Party (PUSC), introduces liberal reforms, including recognition of workers' rights and minimum wages.
1948 - Six-week civil war over a disputed presidential election result.
High-tech future: chip maker Intel is Costa Rica's main exporter
1949 - New constitution gives women and people of African descent the right to vote; armed forces abolished and replaced by civil guard; Jose Figueres Ferrer, co-founder of National Liberation Party (PLN), elected president and begins ambitious socialist programme, including introducing a social security system and nationalising banks.
1958-73 - Costa Rica governed by mainly conservative administrations.
1963-64 - Irazu volcano erupts, causing serious damage to agriculture.
1968 - Arenal volcano erupts, causing many casualties.
1974 - Daniel Oduber (PLN) elected president and pursues socialist policies.
Conservatism and economic deterioration
1978 - Rodrigo Carazo, a conservative, elected president amid a sharp deterioration in the economy.
Colonial legacy: white-faced building in Barva
1982 - Luis Alberto Monge (PLN) elected president and introduces harsh austerity programme. Meanwhile, Costa Rica comes under pressure from the US to weigh in against the Sandinistas in Nicaragua.
1985 - US-trained anti-guerrilla force begins operating following clashes with Sandinista troops.
1986 - Oscar Arias Sanchez (PLN) elected president on a neutral platform.
1987 - Leaders of Nicaragua, El Salvador, Guatemala and Honduras sign peace plan devised by Oscar Arias Sanchez, who in turn wins the Nobel Peace Prize for the plan.
1990 - Rafael Calderon, of the centrist PUSC, elected president.
Oscar Arias won the Nobel Peace price for efforts to end civil conflicts in his region
Served as president 1986 to 1990 and again from 2006 to 2010
1994 - Jose Maria Figueres Olsen (PLN) elected president.
1998 - Miguel Angel Rodriguez (PUSC) elected president.
2000 - President Rodriguez and his Nicaraguan counterpart resolve long-standing dispute over navigation along San Juan river, which serves as their border.
2002 April - Abel Pacheco of the ruling Social Christian Unity Party wins a comfortable 58% of the vote in the second round of presidential elections.
2003 May - Energy and telecommunications workers strike over President Pacheco's privatisation plans; teachers strike over problems in paying their salaries. Strikes prompt three ministers to resign.
2004 July - Three Chilean diplomats are killed by a security guard at their embassy in San Jose.
2004 October - Mounting concern over corruption as three former presidents - Jose Maria Figueres, Miguel Angel Rodriguez and Rafael Angel Calderon - are investigated over contractor payments.
2005 January - National emergency declared as days of heavy rain lead to serious flooding along the Caribbean coast.
2006 February-March - Presidential election ends in a neck-and-neck race between Oscar Arias and Otton Solis. Mr Solis concedes defeat after a manual count and legal challenges.
2006 October - Two-day public workers strike is held in protest at proposed free trade deal with the US.
2007 May - Government says Costa Rica on course to become first voluntarily 'carbon neutral' country.
2007 June - Costa Rica switches diplomatic allegiance from Taiwan to China in a bid to attract Chinese investment.
Free trade deal with US has split Costa Rica like few other issues
CAFTA - Central American Free Trade Agreement
Meant to reduce US-Central America trade barriers
Opponents fear competition will ruin economy
Narrowly approved in referendum in October 2007
Also includes Guatemala, El Salvador, Honduras, Nicaragua, Dominican Republic
2007 October - National referendum narrowly decides in favour of ratifying the Central American Free Trade Agreement (Cafta).
2008 November - Chinese President Hu Jintao makes highest-level visit by a Chinese official since Costa Rica ended diplomatic relations with Taiwan in 2007.
2009 March - President Arias says Costa Rica to re-establish ties with Cuba, 48 years after they broken off in 1961.
2009 October - Former president Rafael Angel Calderon is sentenced to five years in jail after being convicted of corruption.
2010 February - Costa Rica elects first woman president, Laura Chinchilla, who takes office in May.
2011 March - UN International Court of Justice orders Nicaragua and Costa Rica to keep troops back from a disputed river border.