from UNESCO: The ancient ksour are medieval towns with an outstanding example of the type of architectural ensembles illustrating seven centuries of human history. They contain an original and decorative stone architecture, and present a typical model of habitat of Saharan ksour, particularly well integrated to the environment. Their urban fabric is dense and closely-packed; with narrow and twisting lanes running between the blank outer walls of courtyard houses.
These four ancient towns are the only surviving places in Mauritania to have been inhabited since the Middle Ages. They were built originally to serve the caravan routes that began in the 11th century CE to cross the Sahara form north to south and from east to west. Sited on the outskirts of a fertile valley or oasis, their Original function was to provide religious instruction, and so they developed around mosques, accompanied by houses for the teachers and students. warehouses were built to safeguard their goods by traders, who needed accommodation for themselves, whilst inns were provided for those passing through on business. From these elements grew the characteristic form of settlement known as the ksar (plural ksoun, with a stone architecture and an urban form suited to extreme climatic conditions.
Check out the UNESCO web-link above for a beautiful photo gallery of these towns.
According to tradition, Ouadane was founded by three holy men in 1141-42 on the ruins of earlier settlements dating back to the 8th century CE, which had been destroyed or abandoned in savage local wars. It was to become the most important commercial centre of the west Saharan region. A bitter struggle between two clans in 1450 led to the destruction of the first mosque. The town centre moved a short way to the east and flourished again within its fortifications. It was very prosperous between the 14th and 18th centuries owing to its commercially strategic location. An attempt by Portuguese to set up a trading post failed in the 16th century, but Moroccan incursions in the same century had more effect, and Ouadane declined as Chinguetti prospered. Following the arrival of French troops in 1909 the town developed an extra-mural settlement towards the east.