The M'zab valley is located in the middle of the northern part of the Algerian Sahara, in a secluded area with defensive features. The site began to be urbanized at the beginning of the 11th century and consists of five ksour (sing., ksar; fortified settlements), namely: Al-Atteuf (meaning the detour) established in 1011, Bou Noura (the luminous) in 1046, Ghardaïa (inter-mountainous area) which is the main city and established in 1053, Beni Isguen (the middle people) in 1124, and Melika (the royal) in 1347.
This group of five small cities (pentapolis) is commonly cited as an example of original architecture and urbanism, adapted to semi-desert conditions, but above all based on religious, social and moral principles. Indeed, clear planning principles appear in these five ksour. First, they are all built on a rocky spurs, invulnerable to erosion. Second, they are all picturesquely situated on a side of a hill, crowned by a great mosque with a pyramid-shaped minaret. Also, unlike the classical pattern of Islamic cities, they all have souks which are far from the great mosque, and near the gates of the cities to control access to the ksour. In fact, until now, no foreigner is allowed to circulate in the city without a guide.
There are many cemeteries in the M'zab valley, because each fraction buries its dead in a place of its own. The tombs are anonymous and have no inscriptions. Only broken pieces of pottery allow families to distinguish the graves from each other. In addition, each cemetery has a prayer hall or area, to perform funeral prayers (Salat al-Janaza).
The palm groves of the M’zab were artificially set up by local inhabitants with palm trees that were brought from surrounding areas. That of Beni Isguen is defended upstream by a masonry dam reducing the violence of floods which are most certainly rare, but very violent when they occur.
In December 1982, the pentapolis of M’zab was listed as a UNESCO World Heritage Site. Since then, the proliferation of uncontrolled constructions and transformations led to the degradation of the ksour. As a regulatory measure, the Algerian government issued a decree on June 4, 2005, establishing a boundary for safeguarded area. In 2007, a safeguarding and enhancement plan was initiated by the Ministry of Culture and the Wilaya (province) of Ghardaïa.