Early anatomically modern humans are known to have been present at Jebel Irhoud, in what is now Morocco, from about 300,000 years ago. The Nile valley (Ancient Egypt) participated in the development of the Old World Neolithic, Bronze Age and Iron Age, along with the Ancient Near East. By contrast, the Maghreb, including the "Green Sahara", remained in the Mesolithic stage until the 4th millennium BC, with gradual introduction of the Neolithic nomadic pastoralism in the 3rd millennium BC, and early Iron Age Phoenician colonization along the Mediterranean coast from about 1100 BC.
Human habitation in North Africa has been greatly influenced by the climate of the Sahara (currently the world's largest warm desert), which has undergone enormous variations between wet and dry over the last few hundred thousand years. This is due to a 41000-year cycle in which the tilt of the earth changes between 22° and 24.5°. At present (2000 AD), we are in a dry period, but it is expected that the Sahara will become green again in 15000 years (17000 AD).
During the last glacial period, the Sahara was much larger than it is today, extending south beyond its current boundaries. The end of the glacial period brought more rain to the Sahara, from about 8000 BC to 6000 BC, perhaps because of low pressure areas over the collapsing ice sheets to the north. Once the ice sheets were gone, the northern Sahara dried out. In the southern Sahara, the drying trend was initially counteracted by the monsoon, which brought rain further north than it does today. By around 4200 BC, however, the monsoon retreated south to approximately where it is today, leading to the gradual desertification of the Sahara. The Sahara is now as dry as it was about 13,000 years ago.
These conditions are responsible for what has been called the Sahara pump theory. During periods of a wet or "Green Sahara", the Sahara becomes a savanna grassland and various flora and fauna become more common. Following inter-pluvial arid periods, the Sahara area then reverts to desert conditions and the flora and fauna are forced to retreat northwards to the Atlas Mountains, southwards into West Africa, or eastwards into the Nile Valley. This separates populations of some of the species in areas with different climates, forcing them to adapt, possibly giving rise to allopatric speciation.
The earliest inhabitants of central North Africa have left behind significant remains: early remnants of hominid occupation in North Africa, for example, were found in Ain el Hanech, in Setif (c. 200,000 BCE); in fact, more recent investigations have found signs of Oldowan technology there, and indicate a date of up to 1.8 million BC. Some studies have placed the earliest settlement of homo sapiens in North Africa to around 160,000 years ago According to some sources,[who?] North Africa was the site of the highest state of development of Middle Paleolithic flake-tool techniques. Tools of this era, starting about 130,000 BCE, are called Aterian(after the site Bir el Ater, south of Annaba) and are marked by a high standard of workmanship, great variety, and specialization.
The earliest blade industries in North Africa belong to the Iberomaurusian or Oranian (after a site near Oran). This lithic industry appears to have spread throughout the coastal regions of North Africa between 15,000 and 10,000 BC. Between about 9000 and 5000 BC, the Capsian culture made its appearance showing signs to belong to the Neolithic and began influencing the Iberomaurusian, and after about 3000 BC the remains of just one human culture can be found throughout the former region. Neolithic society (marked by animal domestication and subsistence agriculture) spread in the Saharan and Mediterranean North Africa after the Levante between 6000 and 2000 BC. This type of economy, so richly depicted in the Tassili n'Ajjer cave paintings, predominated in North Africa until the classical period.
Saharan rock art was produced in the "Green Sahara" during the Neolithic Subpluvial period (about 8000 to 4000 BC). They were executed by hunter-gatherery of the Capsian period who lived in a savanna region teeming with giant buffalo, elephant, rhinoceros, and hippopotamus.
Equitable conditions during the Neolithic Subpluvial supported increased human settlement of the Nile Valley in Egypt, as well as neolithic societies in Sudan and throughout the present-day Sahara. Cultures producing rock art (notably that at Tassili n'Ajjer in southeastern Algeria) flourished during this period.
The practical consequences of these changes took the form of increased abundance of fish, waterfowl, freshwater molluscs, rodents, hippopotamus and crocodiles. The riches of this increased aquatic biomass were exploited by humans with rafts, boats, weirs, traps, harpoons, nets, hooks, lines and sinkers. This "riparian" (river) way of life supported much larger communities than could that of typical hunting bands. These changes, along with the local development of pottery (whereby liquids could be both stored and heated) resulted in a "culinary revolution" consisting of soup, fish stew and porridge. The last mentioned implies the cooking of gathered cereals.
The classic account of the riparian lifestyle of this period comes from investigations in Sudan during World War II by British archeologist Anthony Arkell. Arkell's report described a Late Stone Age settlement on a sandbank of the Blue Nile which was then about 12 feet (3.7 m) higher than its present flood stage. The countryside was clearly savanna, not the present-day desert, as evidenced by the bones of the most common species found in the middens -- antelope, which require large expanses of seed-bearing grasses. These people probably lived mainly on fish, however, and Arkell concluded, based on the totality of the evidence, that rainfall at the time was at least three times that of today. The physical characteristics derived from skeletal remains suggested that these people were related to modern Nilotic peoples, such as the Nuer and Dinka. Subsequent radiocarbon dating firmly established Arkell's site to between 7000 and 5000 BCE. Based on common patterns at his site and at French-excavated sites already reported from Chad, Mali and Niger (e.g., bone harpoons and a characteristic "wavy line" pottery), Arkell inferred "a common fishing and hunting culture spread by negroid people right across Africa at about the latitude of Khartoum at a time when the climate was so different that it was not desert." The originators of the wavy line pottery are as yet unidentified.
In the 1960s, the archeologist Gabriel Camps investigated the remains of a hunting and fishing community dating from about 6700 BCE in southern Algeria. These pottery-making people (the "wavy line" motif again) were black African rather than Mediterranean in origin and (according to Camps) evidenced definite signs of deliberate cultivation of grain crops as opposed to simply the gathering of wild grains. Later studies at the site have shown the culture to be hunter-gatherers and not agriculturalists, as all the grains were morphologically wild, and the society was not sedentary.
Human remains were found by archaeologists in 2000 at a site known as Gobero in the Ténéré Desert of northeastern Niger. The Gobero finds represent a uniquely preserved record of human habitation and burials from what is now called the Kiffian (7700-6200 BCE) and the Tenerian (5200-2500 BCE) cultures.
Dotted wavy line pottery and fishing cultures have also been located in the Lake Turkana region in poorly dated contexts. By 3000 BCE, it does not appear that the Turkana Basin was populated with harpoon and dotted wavy line pottery users, but fishing remained an important part of peoples' diets into the late Holocene.
The beginning of the Bronze Age in Egypt is conventionally identified as the Protodynastic Period, following the Neolithic Naqada culture about 3200 BC. The Egyptian Bronze Age corresponds to the Old, Middle and New Kingdoms. The Iron Age in Egypt corresponds to the Third Intermediate Period of Egypt.
While the Nile valley (Egypt and Meroë) had entered historicity since the Bronze Age, Tamazgha (Maghreb) remained in the prehistoric period longer. Mesolithic hunter-gatherers are gradually replaced by pastoralists (nomads) by the early 3rd millennium BC. Some Phoenician and Greek colonies were established along the Mediterranean coast during the 7th century BC.