At the end of the Middle Ages, most people in Mauritania made their living either by fishing on the Atlantic coast, or by gathering and selling gum arabic – the hardened sap of the wild acacia tree, used north of the Sahara and all over the Mediterranean and West Asia for printing patterns onto cloth. The kingdom of Mali controlled most of Mauritania, and as in Mali, most of the people who lived in Mauritania followed Islam.
Because gum arabic was worth a lot of money, Europeans were eager to control this production and trade. In 1445, Portuguese ships sent by Prince Henry arrived in Mauritania and traded for both gum arabic and people to sell as slaves. In 1580, when the Spanish took over Portugal, they also took over this trade for gum arabic and slaves. Then as Spain’s power collapsed, in 1638 the Dutch took over trading with Mauritania. Only a generation later, in 1678, the French got control of Mauritania. France kept control of Mauritania for a long time, encouraging the production of a lot of gum arabic and taking it back to France to use for printing patterns on to cloth there.
By about 1820, people weren’t buying so many enslaved people from Mauritania anymore (as in the rest of Africa), but gum arabic just got more and more important. Even after the French Revolution and Napoleon, France continued to control Mauritania.
After World War II, however, France was so weak that they couldn’t control Mauritania anymore. About 1960, Mauritania became an independent country. But the main trade was still selling gum arabic to richer countries, as it still is today.