The Sahara once had a very different environment. In Libya and Algeria, from at least 7000 BC, there was pastoralism, herding of sheep and goats, large settlements and pottery. Cattle were introduced to the Central Sahara (Ahaggar) from 4000 to 3500 BC. Remarkable rock paintings (dated 3500 to 2500 BC), in places which are currently very dry, portray vegetation and animal presence rather different from modern expectations.
As a desert, Sahara is now a hostile expanse that separates the Mediterranean economy from the economy of the Niger basin. As Fernand Braudel points out that crossing such a zone (especially without mechanized transport) is worthwhile only when exceptional circumstances cause the expected gain to outweigh the cost and danger.
Trade, beginning around 300 CE, was conducted by caravans of camels. These camels would be fattened for a number of months on the plains of either the Maghreb or the Sahel before being assembled into a caravan. According to Ibn Battuta, the explorer who accompanied one of the caravans, the average size per caravan was 1,000 camels; some caravans were as large as 12,000. The caravans would be guided by highly paid Berbers who knew the desert and could ensure safe passage from their fellow desert nomads. The survival of a caravan was precarious and would rely on careful coordination. Runners would be sent ahead to oases so that water could be shipped out to the caravan when it was still several days away, as the caravans could not easily carry enough with them to make the full journey. In the middle of the 14th century Ibn Battuta crossed the desert from Sijilmasa via the salt mines at Taghaza to the oasis of Oualata. A guide was sent ahead and water was brought on a journey of four days from Oualata to meet the caravan.
Ancient trade spanned the northeastern corner of the Sahara in the Naqadan era. Predynastic Egyptians in the Naqada I period traded with Nubia to the south, the oases of the Western Desert to the west, and the cultures of the eastern Mediterranean to the east. Many trading routes went from oasis to oasis to resupply on both food and water. These oases were very important. They also imported obsidian from Ethiopia to shape blades and other objects.
The overland route through the Wadi Hammamat from the Nile to the Red Sea was known as early as predynastic times; drawings depicting Egyptian reed boats have been found along the path dating to 4000 BC. Ancient cities dating to the First Dynasty of Egypt arose along both its Nile and Red Sea junctions, testifying to the route's ancient popularity. It became a major route from Thebes to the Red Sea port of Elim, where travelers then moved on to either Asia, Arabia or the Horn of Africa. Records exist documenting knowledge of the route among Senusret I, Seti, Ramesses IV and also, later, the Roman Empire, especially for mining.