Mauritanian nationality law is regulated by the Constitution of Mauritania, as amended; the Mauritanian Nationality Code, and its revisions; and various international agreements to which the country is a signatory. These laws determine who is, or is eligible to be, a national of Mauritania. The legal means to acquire nationality, formal legal membership in a nation, differ from the domestic relationship of rights and obligations between a national and the nation, known as citizenship. Nationality describes the relationship of an individual to the state under international law, whereas citizenship is the domestic relationship of an individual within the nation. Mauritanian nationality is typically obtained under the jus sanguinis, i.e. by birth in Mauritania or abroad to parents with Mauritanian nationality. It can be granted to persons with an affiliation to the country, or to a permanent resident who has lived in the country for a given period of time through naturalization.

Acquisition of nationality Nationality can be acquired in Mauritania at birth or later in life through naturalization.

By birth Mauritanian law makes distinction between derivative nationality for children from mothers and fathers, as well as on the basis of birth in the country. Unless the father of a child born in Mauritania is a foreigner, stateless, or unknown, a child may not acquire nationality from their mother. Children born abroad to a Mauritanian mother and foreign father can not obtain Mauritanian nationality until the year immediately preceding their majority. This means that unless the child automatically obtains the nationality of their father, it will be stateless until becoming an adult. Upon attaining majority, children may repudiate nationality which was obtained through their mother. Those who acquire nationality at birth include:

Children born anywhere to a Mauritanian father; Children born in Mauritania to a Mauritanian mother, if the father is a foreigner, stateless, or unknown; or Newborn foundlings born in the country whose parents are unknown.

By naturalization Naturalization can be granted to persons who have resided in the territory for a sufficient period of time to confirm they understand the customs and traditions of Mauritania and are integrated into the society. Applicants must be fluent in Arabic, Pulaar, Soninké, or the Wolof language. General provisions are that applicants have good character and conduct; are in good physical and mental health; and have no criminal record. Applicants must typically have resided in the country for ten years. Besides foreigners meeting the criteria, other persons who may be naturalized include:

Children legally adopted by a Mauritanian parent, at the time of completion of a legal adoption can obtain Mauritanian nationality at the discretion of authorities; Children born abroad to a Mauritanian mother and foreign father may apply for registration as a national in the year preceding their majority; Minor children are automatically naturalized when their parent acquires nationality; Persons born in the territory who did not acquire nationality at birth may naturalize after a five-year residency; The wife of a Mauritanian national after a five-year residency period; The husband of a Mauritanian national who was married under Sharia law after residing in the territory for five years; or Persons who have performed exceptional service to the nation may naturalize after a five-year residency period.

Loss of nationality There are no provisions in the nationality laws for Mauritanian nationals to renounce their nationality. Mauritanians of origin may lose their nationality for obtaining dual nationality without the permission of the authorities. Naturalized persons may be denaturalized in Mauritania for disloyalty to the state; committing crimes against the state or state security; ordinary crimes; or for fraud, misrepresentation, or concealment in a naturalization petition. Within a year of obtaining naturalization, if a person is found to have a physical or mental disability, their nationality can be revoked, regardless of whether they would become stateless. Persons who previously had nationality, were not deprived of it, and wish to repatriate must request reinstatement, which is discretionary.

History From the third century, Berbers began migrating from the north to the territory and incorporated the indigenous people into their society. By the ninth century, three clans, the Djodala, Lemtuna, and Messufa, established the Sanhadja Confederation. The Lemtuna were the dominant group in the confederation, which controlled trade in the Sahara between the traditional independent nomadic groups and the established Berber Muslims who were involved in commerce. Their territory, known as the Bilad al-Mulathameen (the land of the Mulathameen) or Bilad al-Sanhaja (the land of the Sanhaja) stretched from Aoudaghost in the west to Timbuktu in the east, extending south to Koumbi Saleh. Because of the decentralization of the confederation, they were vulnerable to attacks, such as that waged by the Ghana Empire to seize Aoudaghost in 990. In the early part of the eleventh century the Sanhadja Confederation was replaced by the theocratic Almoravid Empire. The Almoravids established a political community which strictly adhered to Islamic principles. By 1054, they had retaken Aoudaghast from Ghana and in 1076, the Almoravids captured Koumbi Saleh, eventually extending their influence as far as Morocco and southern Spain. They ruled in the territory until the thirteenth century.

African empires and outsider contact (1300–1899) When the Almoravid Empire declined, groups of Yemeni Arabs began raiding in the northern part of the territory, pushing black inhabitants south. Their disruption of the trade routes pushed commerce centers out of the area and toward the east. In 1455, the Portuguese built a trading fort at Arguin and began trading guns for slaves with the Beni Ḥassān, one of the Yemeni Arab groups. With the merger of Portugal and Spain into the Iberian Union in 1580, Spanish traders began dominating the coastal trade. They were driven out by the Dutch in 1638, whose trade focus was gum arabic, a substance used in textile printing. Though the Berbers attempted to stop the encroachments into their territory, they were defeated in the thirty-year conflict known as the Char Bouba war, which lasted from 1644 to 1674. The Ḥassān eventually overtook the entire territory of modern Mauritania, imposing the rigid Moorish social order upon the inhabitants. The Ḥassān Arabs, who ruled were at the apex of the social hierarchy followed by the Berber scholars, known as "zawiya", and herders and farmers, called "znaga" who paid tribute to the rulers. On the lowest tiers were the Haratin, who had formerly been slaves and the slaves, who were typically black Africans.

By 1678 the French drove the Dutch from the region, establishing a settlement at the mouth of the Senegal River, known as Saint-Louis, which became their trading center. Trading with the Ḥassān from the base in Saint-Louis, European traders preferred to avoid the difficult coast and desert climate of the territory and the Ḥassān were able to exploit European rivalries to obtain preferential trade agreements and gifts. In 1796, Britain ousted France from West Africa, but after the Napoleonic Wars, the Congress of Vienna in 1815, returned the coastal territory from Cap Blanc to Saint-Louis to France. The Ḥassān continued their traditional practices of raiding and warfare, buying arms from the French. Administering the territory from Saint-Louis, the French did not focus on the area unless the actions of the Arab rulers interrupted the gum arabic trade and when that happened they dispatched troops to take punitive action. A French officer, Jean-François Caillé, first named the territory Mauritania in 1843, but the name did not come into official use until 1899. French forces conquered a few small states in the region, the Brakna, Oualo, and Trarza emirates, in the 1850s extending a protectorate over Brakna and Trarza. They also undertook a program to map the territory, but increasingly their scientific expeditions were under attack and the leaders held for ransom.

French period (1899–1960) In 1899, a decision was made to take steps to protect Mauritania, which was an important link for trade between Senegal and Morocco. Xavier Coppolani was tasked with devising a plan, and he arrived in the area in 1901. The two-pronged approach Coppolani used involved securing alliances with Berber scholars, while at the same time using the conflicts between rival Ḥassān leaders to weaken their resistance. By 1904, Coppolani's plan had organized French military posts throughout the central and southern areas of the region and the Civil Territory of Mauritania was established. To take the northern Adrar Region, he convinced the French government to send military forces, but was killed in May 1905, before the troops set out. In 1908, Colonel Henri Gouraud was appointed as commissioner of the Territory and led a four-year campaign to subdue the north.

Under Article 109 of the French Constitution of 1848, French territories were to be governed by specific laws until the constitution was extended there. This provision laid the groundwork for nationality legislation based upon whether the native inhabitants were able to be assimilated by adopting European standards. From 1848, those persons who settled in the colonies and were from France were considered nationals who had full rights and were subject to French law. However, those born in the new territories were considered to be nationals without citizenship. Nationals in the older colonies of the Antilles, Guiana, Réunion and parts of India and Senegal were granted political rights, but those in new colonies were confirmed by a decree on 14 July 1865 to be subjects and not citizens, unless they renounced their allegiance to native custom and possessed sufficient understanding of the obligations of citizenship.

Also in 1848, slavery was abolished throughout the French Empire and the Civil Code was extended to all of the French citizens in the colonies. Under the Civil Code, women were legally incapacitated and paternal authority was established over their children. Upon marriage, a woman married to a French man automatically acquired the same nationality as her spouse. Illegitimate children were barred from inheritance and nationality could only be transmitted through a father. Non-citizen nationals were governed by traditional laws concerning marriage and inheritance which placed the well-being of the community above individual rights. These laws prevented a wife from being treated as a slave, required her husband to support her, and entitled her kin to a bride price, to compensate them for the loss of her fertility to their kinship group and secure the legality of the union. Having paid the price for the marriage contract, she and her offspring belonged to the kinship network of her husband and could be inherited if her husband died.