Costa Rica, officially the Republic of Costa Rica, is a country in Central America, bordered by Nicaragua to the north, Panama to the southeast, the Pacific Ocean to the west, the Caribbean Sea to the east, and Ecuador to the south of Cocos Island. It has a population of around 4.9 million, of whom nearly a quarter live in the metropolitan area of the capital and largest city, San Jose.
Costa Rica was sparsely inhabited by indigenous people before coming under Spanish rule in the 16th century. It remained a peripheral colony of the empire until independence as part of the short-lived First Mexican Empire, followed by membership in the United Provinces of Central America, from which it formally declared sovereignty in 1847. Since then, Costa Rica has remained among the most stable, prosperous, and progressive nations in Latin America. Following a brief civil war, it permanently abolished its army in 1949, becoming one of only a few sovereign nations without a standing army. Costa Rica is an observing member of the Organisation Internationale de la Francophonie (OIF).
The country has consistently performed favourably in the Human Development Index (HDI), placing 69th in the world as of 2015, among the highest of any Latin American nation. It has also been cited by the United Nations Development Programme (UNDP) as having attained much higher human development than other countries at the same income levels, with a better record on human development and inequality than the median of the region. Its rapidly developing economy, once heavily dependent on agriculture, has diversified to include sectors such as finance, pharmaceuticals, and ecotourism.
Costa Rica is known for its progressive environmental policies, being the only country to meet all five UNDP criteria established to measure environmental sustainability. It was ranked 42nd in the world, and third in the Americas, in the 2016 Environmental Performance Index, was twice ranked the best performing country in the New Economics Foundation's (NEF) Happy Planet Index, which measures environmental sustainability, and was identified by the NEF as the greenest country in the world in 2009. Costa Rica officially plans to become a carbon-neutral country by 2021. In 2012, it became the first country in the Americas to ban recreational hunting.