Costa Rica, which elects a new president Sunday, is a small country thriving on ecotourism. Its neutrality, strong democracy and political stability have earned it the nickname of Central America's Switzerland.

Here are four facts about the country of more than five million people:

In this file photo taken in 2018, a woman casts her vote at a polling station in San Jose in 2018
In this file photo taken in 2018, a woman casts her vote at a polling station in San Jose in 2018 AFP

Independent since 1821, Costa Rica is considered a model of democracy in Central America.

A short civil war in 1948 led to the abolition of the army and helped put in place the country's political stability.

In the 1980s, when several other Central American countries were mired in civil wars, neutral Costa Rica acted as peace broker, earning then-president Oscar Arias Sanchez the Nobel Peace Prize in 1987.

It saw a political shift in 2014, when the two rightwing parties that had shared power since the 1960s -- the PLN and PUSC -- suffered an historic defeat as centrist Luis Guillermo Solis was elected president.

This file photo taken in 2019 shows a view of the Gandoca-Manzanillo National Wildlife Refuge in Limon, Costa Rica
This file photo taken in 2019 shows a view of the Gandoca-Manzanillo National Wildlife Refuge in Limon, Costa Rica AFP / Ezequiel BECERRA

Outgoing president Carlos Alvarado is from the same party.

On the international stage Costa Rica has fought for disarmament and for a total end to nuclear weapons and the strengthening of the non-proliferation regime.

Over recent years it has seen an increase in organised crime, largely due to the drug trafficking that has ravaged its neighbours.

With its stunning beaches on the Pacific and Caribbean coasts, its lush rainforests and imposing volcanoes, Costa Rica has become known as a green democracy and global leader for its environmental policies.

A view of a crowded street during sunset in San Jose in 2019
A view of a crowded street during sunset in San Jose in 2019 AFP / Ezequiel BECERRA

Nature reserves cover a quarter of Costa Rica's 51,000 square kilometres (19,700 square miles), territory that hosts five percent of the world's biodiversity.

It is one of the few countries to have banned blood sports and to have shunned exploitation by the mining and oil giants, which are the main source of income for many Latin American countries.

Over the last decade the environment has nevertheless come under strain from economic development, with a poor administration of protected areas, increasing air, ground and water pollution, and damage caused by the cultivation of pineapples.

Costa Rica is nevertheless the only tropical country which has managed to reverse deforestation, according to the World Bank.

Costa Rica is known for neutrality, strong democracy and political stability
Costa Rica is known for neutrality, strong democracy and political stability AFP / Ezequiel BECERRA

It has invested heavily in clean energy, passing the threshold of generating electricity exclusively from renewable energy 300 days in one year, in 2017.

The nation has vowed to eliminate the use of fossil fuels by 2050.

Costa Rica has seen 25 years of regular economic growth, thanks to the opening up to foreign investment and a gradual liberalisation of foreign trade.

Its main exports are bananas, pineapples and coffee. It is also the world's biggest exporter of butterflies.

GDP per capita has tripled since 1960, but in 2020 it contracted by 4.1 percent due to the Covid pandemic.

In 2021 growth was expected to reach 3.8 percent, according to the World Bank.

The poverty rate that year rose to 23 percent, according to official statistics.

Costa Rica has a top-notch social security system and has invested heavily in education.

It is ranked 62nd out of 189 countries on the UN's Human Development Index.

The tourism sector represents eight percent of GDP, but was hammered by the pandemic.

A member of the OECD since 2021, the country has been trying to attract digital nomads to boost its economy.

More than 100,000 Nicaraguans, fleeing the violent crackdown on anti-government protests, have taken refuge in Costa Rica.

A conservative, religious country, but with a long tradition of opening its arms to asylum seekers, Costa Rica has taken in hundreds of lesbians, gays, bisexuals and transgender people who were persecuted in their home countries in Central America.