One of Africa's newest oil producers, Mauritania bridges the Arab Maghreb and western sub-Saharan Africa.
The largely-desert country presents a cultural contrast, with an Arab-Berber population to the north and black Africans to the south. Many of its people are nomads.
In the Middle Ages Mauritania was the cradle of the Almoravid movement, which spread Islam throughout the region and for a while controlled the Islamic part of Spain.
European traders began to show interest in Mauritania in the 15th century. France gained control of the coastal region in 1817, and in 1904 a formal French protectorate was extended over the territory.
Morocco opposed the country's independence in 1960 and for a time tried to absorb it. But Morocco's King Hassan II later improved ties as part of his plan to divide Western Sahara.
At a glance
- Politics: A coup in 2005 ended President Taya's two decades of authoritarian rule; presidential polls in March 2007 marked the start of a short-lived move towards democracy - another coup followed a year later
- Economy: Mauritania depends heavily on drought-prone agriculture; its rich coastal fishing grounds are threatened by over-exploitation; offshore oil exploitation began in 2006
- International: Al-Qaeda militants are presenting a serious challenge and have kidnapped and killed several foreigners
Country profiles compiled by BBC Monitoring
The eventual deal in 1976 brought more problems, though, with Mauritania coming under attack by Polisario Front guerrillas, who opposed Moroccan control of Western Sahara, and the subsequent downfall of the leader since independence - Moktar Ould Daddah - in a military coup.
Peace was agreed with the Polisario in 1979, but this in turn worsened relations with Morocco, until a detente in 1985. More recently, ties with Senegal have been strained over the use of the Senegal River, which forms the border between the two countries.
Mauritania officially banned slavery in 1981. The government has denied accusations that it is still being practised, in spite of evidence to the contrary.
One of the world's poorest countries, Mauritania has pinned hopes for future prosperity on the exploitation of its offshore reserves of oil and natural gas. The Chinguetti and Tiof fields are expected to yield millions of barrels of oil.
The country forged diplomatic ties with Israel in 1999, one of three Arab nations to have done so, but severed them in 2009 in protest at Israel's then military operation in Gaza.
Under former President Maaouiya Ould Sid Ahmed Taya, Mauritania was an ally of the US in its worldwide fight against al-Qaeda. American special forces were despatched to train Mauritanian troops.
Al-Qaeda militants operating in Mauritania, Algeria and Mali have become increasingly active, kidnapping and killing several foreigners.