For miles, there are only plains of orange Saharan sand, a dusty empty road, shepherds in white turbans leading camels and sheep to patches of parched grass.
Then the road curves and there's a surprising sight: an oasis of shimmering green palm trees and farmland, and bustling hilltop cities of small houses in the warm shades of a desert sunset.
The outcast Muslim tribe that settled the M'zab Valley in Algeria a millennium ago brought life and civilization to a barren land that nobody else wanted. Under the sun-baked sand, they built a system of canals that turned the valley green by storing and distributing water from the big floods that reach the valley once every three to 10 years.
The ancient irrigation system still keeps the region alive and thriving. But it's increasingly under threat from a modern problem -- urban sprawl, which could one day crowd out the palm groves that make life here livable and, in turn, dry up the water supply. It's a problem in many mid-size Saharan oases.
"If we keep building, we could do damage to the entire ecological system," said resident Abdelkader Ben Mohammed, who has watched the region grow in the last few decades to accommodate cars and factories that make gas pipelines or textiles.
The M'zab, about 300 miles south of the Algerian capital of Algiers, is a collection of hilltop cities of low, flat houses, each hill with its own streamlined stone minaret piercing the sky. It is home to 150,000 to 200,000 people. That population has grown with industrialization, declining death rates and more births.
In the sinuous, narrow streets of Ghardaia, one of the five historic M'zab cities, market stands sell dates, carrots and coriander. One visitor wonders: Surely they must be imported?
"No, they're grown right here," responded greengrocer Mohammed Tafadjna, pointing down the hill toward green valleys nourished by the irrigation systems.
Long ago, the people who settled the M'zab realized that they couldn't try to store water above the ground, where it would quickly evaporate. Instead, they let the water sink into the sand, channeling it with underground canals and walls.
Small holes in those underground walls let water trickle slowly into the gardens. Aboveground, palm trees kept the area shady and prevented the water stores from evaporating.
For centuries, those cool, tranquil areas outside the city walls remained mostly undeveloped. People lived in the clusters of boxy houses up on the hilltops and went down to the valleys in the summer to cool off -- a fond memory for physics teacher Brahim Hadjout.
"The palm forests were tended by our ancestors, so we have to take care of them," said Hadjout, who wears a djellaba, the traditional white gown that most men here wear.
Although the people of the M'zab are watchful of traditions, the desire for new houses is a problem, heritage experts say. Many younger residents don't want to squeeze into the traditional homes shared by extended families in the pedestrian streets of the old cities. They want homes of their own and the convenience of being able to park their cars out front.
People are building in the valleys, where they have room to park, said Pietro Laureano, an Italian architect and specialist in ancient water systems who lived in the Sahara for eight years.
To make room, people are cutting down the palm trees. The Environment Ministry estimates that 150,000 palms have already been lost in the region.
"If people destroy the palm groves, eventually there will be no more water left," said Laureano, who often consults for UNESCO, which designates and seeks to protect world heritage sites.
Another problem: The new houses are made of concrete, which doesn't keep them as cool as the stone of ancient houses, he said. So people install air-conditioners, which, like the cars, pollute the irrigation systems.
If the M'zab's oases dried up, it wouldn't be an environmental catastrophe -- after all, the irrigation system is man-made. And it wouldn't be an economic disaster, as the region depends more on industry and trade than farming. Still, it could destabilize a unique desert civilization.
The M'zab is home to a sect called the Ibadites, who practice a strict form of Islam. Within city limits, people aren't allowed to drink alcoholic beverages or smoke, and there are signs to let visitors know it.
For Ghardaia, the Islamic insurgency that has raged in northern Algeria for a decade has seemed far away because attacks are rare in the desert.
There is little poverty in Ghardaia, residents say, because their strong faith dictates that they band together to help the needy. People also take turns cleaning the winding streets and patrolling for crime.
"We have the same problems as in other cities, like unemployment, but here people take care of each other," said Sadi Belkhir, his small sons clinging shyly to his legs.
Throughout Ghardaia, children play in the winding streets. Women enjoy little of their children's freedom. They rarely venture outside and when they do, they wear a constricting white veil that leaves only a hole for one eye -- a tradition under their strict interpretation of Islam.
The Ibadites' cities are famous for working in harmony with nature, not against it. Houses here have thick walls and narrow windows, keeping people cool. Small niches carved into walls collect rare rainwater.
UNESCO named the M'zab as an important world heritage site in 1982. Since December, Ghardaia has also been headquarters to the Foundation of World Deserts, an international initiative set up by the Algerian government to fight the desert's problems.
Algeria has the largest stretch of the Sahara in its territory, so it has a strong interest in protecting the desert. In some parts of Algeria's desert, date palms are being destroyed by a killer fungus. Elsewhere, there's a serious problem of desertification -- green land turning into desert because of overgrazing.
Other desert problems include displacement of nomadic peoples because of war, and pillaging of archeological sites by tourists seeking souvenirs.
The new foundation is intended to fight desertification and protect desert civilizations. Although it remains to be seen whether it can expand its influence outside the Sahara, it is already active in the M'zab, and has provided $152,000 to help patch wear and tear in the irrigation systems.
The problem of overbuilding might be harder to curb. Algeria has banned sprawl in the M'zab, but people keep building anyway.
On a hill overlooking the cities, Kaci Mahrour, an architecture professor who has been studying the M'zab for decades, points out construction projects visible among the palms.
"Eventually, the cities will join together," Mahrour said.
The sprawl could wipe out the palm groves and turn the oasis into a dusty metropolis.
"We can't control everyone who wants to build a new house," Mahrour said. "It's a question of reminding them that what they already have is better."