Mauritania, the geographic and cultural link between North and Sub-Saharan Africa, has been politically stable for the past decade, but is criticised for its human rights record and slavery.
Here are key facts about the Muslim country of 4.5 million people, where voting was underway in Saturday's first round elections to replace President Mohamed Ould Abdel Aziz.
The vast, largely desert country covers 1,030,000 square kilometres (398,000 square miles), about as big as Egypt and twice the size of France.
Washed by the Atlantic, it borders Algeria and the Morocco-annexed Western Sahara in the Maghreb, and Senegal and Mali in Sub-Saharan Africa.
Berber-Arab Moors make up more than two thirds of the population, with black Africans accounting for the rest. Some 99 percent are Muslim. While Sharia, or Islamic law, is in force, extreme punishments such as the death penalty and flogging have not been applied since the 1980s.
The site of an ancient Berber kingdom, Mauritania was gradually settled by Arabs during the Middle Ages. In the 19th and early 20th centuries it was absorbed into France's colonial empire. Independence was declared in 1960 under the presidency of Moktar Ould Daddah.
A string of military coups followed between 1978 and 2008, and inter-ethnic violence in 1989-1991.
Current president Abdel Aziz seized power in a military coup in 2008, overthrowing the first democratically elected president.
He subsequently won a presidential election in 2009 and was again in 2014 at elections boycotted by the main opposition parties. He can not stand for a third term.
Amnesty International and some 30 other rights groups in June called on candidates in the presidential ballot to end slavery and violence against women.
Mauritania was the last country in the world to abolish slavery in 1981, after light-skinned Berber-Arab Moors enslaved local black populations when they settled there centuries ago.
In 2015, parliament doubled prison terms for the practice.
Up to 43,000 people remained in bondage in 2016, around one percent of the population, according to Amnesty.
Taking on jihadists
Hard hit by attacks and abductions of foreigners in the early 2000s, in 2010 and 2011 Mauritania carried out raids on Al-Qaeda in the Islamic Maghreb (AQIM) bases in Mali.
It has worked with regional allies and the international community to fight jihadism in the Sahel, rebuilding its army, improving territorial surveillance and developing the most remote area, especially near Mali.
Iron ore, fisheries main earners
Mauritania is an exporter of iron ore, although production has falled in recent years. It also exports fisheries, and to a lesser extent gold and copper.
From 2006 to 2017 it also drilled for oil, but complex geological conditions and high costs led to the dismantling of the Chinguetti oil field in early 2018, according to the World Bank.
Growth has been on an upward trajectory since 2015, rising to 3.6 percent in 2018, but is insufficient to meet the needs of a fast-growing population, the World Bank says.
Literacy rates are low and 31 percent lived below the poverty line in 2014, the last year for which the World Bank published figures.