Around 9,000 to 10,000 years ago this region was probably a tropical jungle, from a time when the Sahara had plants and lakes in abundance.
Merzouga began as an uninhabited oasis. It became a stopping point for merchants heading to Timbuktu, and later a place of pilgrimage for Ait Atta nomads. The big trade power was Rissani, about 35 km north-west, where the kingdom of Sijilmassa grew rich from the 8th to the 14th century by controlling the caravan routes.
French rule left forts in the area, built by Foreign Legion troops after the battles of Taflalet between 1916 and 1932. The French also built Erfoud around the 1920s, though ksars, fortified villages, had stood in the region for centuries.
Tourism changed the village. Merzouga is now the tourist centre on the western side of the dunes, with hotels and auberges along the sand, and people sometimes call Erg Chebbi the dunes of Merzouga. More visitors brought worries about litter in the dunes. In 2019 the authorities closed unlicensed desert camps over waste, water use and infrastructure, which caused argument locally because tourism is a large part of the economy.
Water, rare as it is, shapes the recent story. On the night of 26 May 2006 flash floods hit the village, displacing 1,200 people and killing three. About 140 houses and hotels were destroyed. In October 2024 heavy rain made temporary lakes in dry areas, something not seen in decades, and the seasonal Yasmina Lake re-formed.