The original inhabitants of Mauritania were the Bafour, presumably a Mande ethnic group, connected to the contemporary Arabized minor social group of Imraguen ("fishermen") on the Atlantic coast.

The territory of Mauritania was on the fringe of geographical knowledge of Libya in classical antiquity. Berber immigration took place from about the 3rd century. Mauritania takes its name from the ancient Berber kingdom and later Roman province of Mauretania, and thus ultimately from the Mauri people, even though the respective territories do not overlap, historical Mauritania being considerably further north than modern Mauritania.

The Umayyads were the first Arab Muslims to enter Mauritania. During the Islamic conquests, they made incursions into Mauritania and were present in the region by the end of the 7th century. Many Berber tribes in Mauritania fled the arrival of the Arabs to the Gao region in Mali.

The European colonial powers of the 19th century had little interest in Mauritania. The French Republic was mostly interested in the territory for strategic reason, as a connection between their possessions in North and in West Africa. Mauritania thus became part of French West Africa in 1904, but colonial control was mostly limited to the coast and the Saharan trade routes, and there were territories nominally within French West Africa which were not reached by European control as late as 1955.

In 1960, the Islamic Republic of Mauritania became Independent of France. The conflict over the former Spanish territory of Western Sahara in 1976 resulted in partial annexation by Mauritania, withdrawn in favour of Morocco in 1979. The long-serving President Maaouya Ould Sid'Ahmed Taya was ousted by the military of Mauritania and replaced by the Military Council for Justice and Democracy in a coup d'état in 2005. A new constitution was passed in 2006. An indecisive election in 2007 triggered another coup in 2008. A leader of the 2005 coup, Mohamed Ould Abdel Aziz, was elected president in 2009. After his ten-year presidency, Mohamed Ould Ghazouani's victory in the 2019 Mauritanian presidential election was presented as having been the country's first peaceful transition of power since independence.

Early history

The Sahara has linked rather than divided the peoples who inhabit it and has served as an avenue for migration and conquest. Mauritania, lying next to the Atlantic coast at the western edge of the desert, received and assimilated into its complex society many waves of these migrants and conquerors.

What is now Mauritania was a dry savanna area during classical antiquity, where independent tribes like the Pharusii and the Perorsi (and the Nigritae near the Niger river) lived a semi-nomadic lifestyle facing growing desertification.

The Romans explored toward this area and probably reached, with Suetonius Paulinus, the area of Adrar. There is evidence (coins, fibulas) of Roman commerce in Akjoujt and Tamkartkart near Tichit.

Berbers moved south to Mauritania beginning in the 3rd century, followed by Arabs in the late 7th century, subjugating and assimilating Mauritania's original inhabitants. From the 8th through the 15th century, black kingdoms of the western Sudan, such as Ghana, Mali, and Songhai, brought their political culture from the south.Warner, Rachel. "Historical setting". In Mauritania: A Country Study (Robert E. Handloff, editor). Library of Congress Federal Research Division (June 1988). This article incorporates text from this source, which is in the public domain.

The divisive tendencies of the various groups within Mauritanian society have always worked against the development of Mauritanian unity. Both the Sanhadja Confederation, at its height from the 8th to the 10th century, and the Almoravid Empire, from the 11th to the 12th century, were weakened by internecine warfare, and both succumbed to further invasions from the Ghana Empire and the Almohad Empire, respectively.

Islamization The Umayyads were the first Arab Muslims to enter Mauritania. During the Islamic conquests, they made incursions into Mauritania and were present in the region by the end of the 7th century. Many Berber tribes in Mauritania fled the arrival of the Arabs to the Gao region in Mali. By the 11th century, Islamization had reached the region around the Senegal River.

In the 11th century, several nomadic Berber confederations in the desert regions overlapping present-day Mauritania joined together to form the Almoravid movement. They expanded north and south, spawning an important empire that stretched from the Sahara to the Iberian Peninsula in Europe. However, the legacy of the southern Almoravids in the Sahara is less well-documented and understood than their subsequent operations in the north. Arabic sources record that Abu Bakr, one of the early leaders of the Almoravids, made Azuggi his base after he left Marrakesh and the northern Almoravids under the control of Yusuf Ibn Tashfin. According to Arabic sources, he also led the Almoravids further south to conquer the ancient and extensive Ghana Empire around 1076, but this narrative has been disputed and debated by modern historians.

The decline of the Almoravids after this is not documented. From the 13th century onward, the Banu Ma'qil, an Arab tribal confederation of Yemeni origin, migrated into the Maghreb and into what is now Morocco. Some of them progressively moved south into the Sahara, identifying themselves as the Beni Ḥassān or Awlad Hassan. From 1644 to 1674, the indigenous peoples of the area that is modern Mauritania made what became their final effort to repel the Ma'qil Arabs who were invading their territory. This effort, which was unsuccessful, is known as the Char Bouba War. The invaders were led by the Beni Ḥassān tribe. The descendants of the Beni Hassan warriors became the upper stratum of society. Hassaniya, a bedouin Arabic dialect named for the Beni Hassan, became the dominant language among the largely nomadic population.

From the 15th to the 19th century, European contact with Mauritania was dominated by the trade for gum arabic. Rivalries among European powers enabled the Arab-Berber population to maintain their independence and later to exact annual payments from France, whose sovereignty over the Senegal River and the Mauritanian coast was recognized by the Congress of Vienna in 1815. Although penetration beyond the coast and the Senegal River began in earnest under Louis Faidherbe, governor of Senegal in the mid-19th century, European conquest or "pacification" of the entire country did not begin until 1900. Because extensive European contact began so late in the country's history, the traditional social structure carried over into modern times with little change.

French colonization

The history of French colonial policy in Mauritania is closely tied to that of the other French possessions in West Africa, particularly to that of Senegal, on which Mauritania was economically, politically, and administratively dependent until independence. The French policy of assimilation and direct rule, however, was never applied with any vigor in Mauritania, where a system that corresponded more to indirectly ruling the colony developed. Colonial administrators relied extensively on Islamic religious leaders and the traditional warrior groups to maintain their rule and carry out their policies. Moreover, little attempt was made to develop the country's economy.

After World War II, Mauritania, along with the rest of French West Africa, was involved in a series of reforms of the French colonial system, culminating in independence in November 1960. These reforms were part of a trend away from the official policies of assimilation and direct rule in favor of administrative decentralization and internal autonomy. Although the nationalistic fervor sweeping French West Africa at this time was largely absent in Mauritania, continuous politicking (averaging one election every eighteen months between 1946 and 1958) provided training for political leaders and awakened a political consciousness among the populace. On 28 July 1960 France agreed to Mauritania becoming fully independent.https://select.nytimes.com/mem/archive/pdf?res=F50F11FD3B551A7A93CBAB178CD85F448685F9 Nevertheless, when Mauritania declared its independence on 28 November 1960, its level of political as well as economic development was, at best, embryonic.

Independence, Ould Daddah era, and the Saharan War

As the country gained independence on November 28, 1960, the capital city, Nouakchott, was founded at the site of a small village founded during the colonial period, the Ksar, while 90% of the population was still nomadic. With independence, larger numbers of ethnic Sub-Saharan Africans (Haalpulaar, Soninke, and Wolof) entered Mauritania, moving into the area north of the Senegal River. As before independence, the sedentary lifestyle of these groups made them more receptive to and useful in state formation, and they quickly came to dominate state administration, even if the Moorish groups built up by the French remained in charge of the political process. Moors reacted to this change by increasing pressures for Arabization, to Arabicize many aspects of Mauritanian life, such as law and language, and ethnic tension built up – helped by a common memory of warfare and slave raids.

President Moktar Ould Daddah, originally assisted to the post by the French, rapidly reformed Mauritania into an authoritarian one-party state in 1964, with his new Mauritanian constitution. Daddah's own Parti du Peuple Mauritanien (PPM) became the ruling organization. The President justified this decision on the grounds that he considered Mauritania unready for western-style multi-party democracy. Under this one-party constitution, Daddah was reelected in uncontested elections in 1966, 1971 and 1976.

To take advantage of the country's sizable iron ore deposits in Zouérat, the new government built a 675-km railway and a mining port. Production began in 1963. The mines were operated by a foreign owned consortium that paid its approximately 3,000 expatriate workers handsomely – their salaries accounted for two-thirds of the country's entire wages bill. When the Mauritanian miners went on a two-month strike in the late 1960s the army intervened and eight miners were killed. Left-wing opposition to the government mounted and some miners formed a clandestine Marxist union in 1973. President Ould Daddah survived the challenge from left-wing opponents by nationalizing the company in 1974 and withdrawing from the franc zone, substituting the ouguiya for the CFA.

In 1975, partly for nationalist reasons and partly for fear of Moroccan expansionism, Mauritania invaded and annexed the southern third of the former Spanish Sahara (now Western Sahara) in 1975, renaming it Tiris al-Gharbiyya. However, after nearly three years of raids by the Sahrawi guerrillas of the Polisario Front, Mauritania's economic and political stability began to crumble. Despite French and Moroccan military aid , Polisario raids against the Zouerate railway and mines threatened to bring about economic collapse, and there were deep misgivings in the military about the Saharan adventure. Ethnic unrest contributed to the disarray. Black Africans from the south were conscripted as front-line soldiers, after the northern Sahrawi minorities and their Moorish kin had proven unreliable in the fight against Polisario, but many of the southerners rebelled against having to fight what they considered an inter-Arab war. After the government quarters in Nouakchott had twice been shelled by Polisario forces, unrest simmered, but Daddah's only response was to further tighten his hold on power.