Costa Rica ( ( listen); Spanish: [ˈkosta ˈrika]; "Rich Coast"), officially the Republic of Costa Rica (Spanish: República de 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, in a land area of 51,060 square kilometers (19,714 square miles); over 300,000 live in the capital and largest city, San José, which had a population of an estimated 333,980 in 2015.Costa Rica has been known for its stable democracy, in a region that has had some instability, and for its highly educated workforce, most of whom speak English. The country spends roughly 6.9% of its budget (2016) on education, compared to a global average of 4.4%. Its economy, once heavily dependent on agriculture, has diversified to include sectors such as finance, corporate services for foreign companies, pharmaceuticals, and ecotourism. Many foreign companies (manufacturing and services) operate in Costa Rica's Free Trade Zones (FTZ) where they benefit from investment and tax incentives.In spite of impressive growth in the gross domestic product (GDP), low inflation, moderate interest rates and an acceptable unemployment level, Costa Rica in 2017 was facing a liquidity crisis due to a growing debt and budget deficit. By August 2017, the Treasury was having difficulty paying its obligations. Other challenges facing the country in its attempts to improve the economy by increasing foreign investment include a poor infrastructure and a need to improve public sector efficiency.Costa Rica was sparsely inhabited by indigenous peoples 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 independence in 1847. Since then, Costa Rica has remained among the most stable, prosperous, and progressive nations in Latin America. Following the brief Costa Rican Civil War, it permanently abolished its army in 1949, becoming one of only a few sovereign nations without a standing army.The country has consistently performed favorably 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.Costa Rica also has progressive environmental policies. It is 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, and 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 plans to become a carbon-neutral country by 2021. By 2016, 98.1% of its electricity was generated from green sources particularly hydro, solar, geothermal and biomass.