From NASA's Earth Observatory:
In southwestern Libya, near the borders of Algeria and Niger, lies a sand sea known as Idhan Murzuq (also Sahra Marzuq) that rarely receives water from either sky or land. The extreme desert’s complex dunes are shaped by dry winds. But extending from the northeast quarter, a corridor of sand lines what used to be a river channel: Wadi Barjuj.
The Moderate Resolution Imaging Spectroradiometer (MODIS) on NASA’s Terra satellite captured this natural-color image on December 7, 2011. Sand dunes stand out especially in the northwestern part of Idhan Murzuq, though the entire sand sea contrasts with its rockier surroundings.
A study published in 2008 and relying on data from multiple NASA sensors reconstructed Libya’s geology and hydrology over the past 7 million years. Over that span, Libya intermittently experienced humid, rainy conditions. One finding was that Wadi Barjuj was probably a tributary in a river system that drained into the Mediterranean Sea though eastern Libya.
Rivers naturally migrate and change over time, and Wadi Barjuj was no exception. Volcanoes began to rise northeast of Wadi Barjuj, and sometime between 5 million and 2 million years ago they blocked the river’s path. With its route blocked, the river system stopped flowing to the sea and instead began feeding a lake. Researchers have named it Lake Megafazzan, estimating its maximum size at about 135,000 square kilometers (52,000 square miles). During humid periods of the past, they explained, Libya was “a veritable lake district.”
Massive as it was, Lake Megafazzan did not cover all of southwestern Libya. Today’s Idhan Murzuq was likely above water during most of the past several million years. It was not, however, a sand sea throughout that entire period. Researchers found evidence of sand seas starting to form after volcanoes blocked the path of Wadi Barjuj and after the massive lake began backing up toward the southwest.