# History of North Africa

The history of North Africa has been divided into its prehistory, its classical period, the arrival and spread of Islam, the colonial period, and finally the post-independence era, in which the current nations were formed. The region has been influenced by many diverse cultures. The development of sea travel firmly brought the region into the Mediterranean world, especially during the classical period. In the 1st millennium AD, the Sahara became an equally important area for trade as camel caravans brought goods and people from the south of the Sahara. The region also has a small but crucial land link to the Middle East, and that area has also played a key role in the history of North Africa.

## Geography

North Africa is a relatively thin strip of land between the Sahara desert and the Mediterranean, stretching from Moroccan Atlantic coast to Egypt. The region has no set definition, and varies from source to source. Generally included are, from west to east, Morocco, Algeria, Tunisia, Libya and Egypt. The area located at the south of the desert is a steppe, a semi-arid region, called the Sahel. It is the ecoclimatic and biogeographic zone of transition in Africa between the Sahara desert to the north and the Sudanian Savanna to the south. The Sudanian Savanna is a broad belt of tropical savanna that spans the African continent, from the Atlantic Ocean coast in the West Sudanian savanna to the Ethiopian Highlands in the East Sudanian savanna.

## Climate

In 15,000 BP, the West African Monsoon transformed the landscape of Africa and began the Green Sahara period; greater rainfall during the summer season resulted in the growth of humid conditions (e.g., lakes, wetlands) and the savanna (e.g., grassland, shrubland) in North Africa. Between 5500 BP and 4000 BP, the Green Sahara period ended.

## Prehistory

The earliest known humans lived in North Africa around 260,000 BC. Through most of the Stone Age the climate in the region was very different from today, the Sahara being far more moist and savanna like. Home to herds of large mammals, this area could support a large hunter-gatherer population and the Aterian culture that developed was one of the most advanced paleolithic societies.
In the Mesolithic period, Capsian culture dominated the central part of North Africa with Neolithic farmers becoming predominant by 6000 BC. Over this period, the Sahara region was steadily drying, creating a barrier between North Africa and the rest of Africa.
In 10,000 BP, engraved and painted Central Saharan rock art began to be created, spanning the Bubaline Period, Kel Essuf Period, Round Head Period, Pastoral Period, Caballine Period, and Cameline Period.
Archaeological evidence has attested that population settlements occurred in Nubia as early as the Late Pleistocene era and from the 5th millennium BC onwards, whereas there is "no or scanty evidence" of human presence in the Egyptian Nile Valley during these periods, which may be due to problems in site preservation.
The Nile Valley on the eastern edge of North Africa is one of the richest agricultural areas in the world. The desiccation of the Sahara is believed to have increased the population density in the Nile Valley and large cities developed. Eventually, ancient Egypt unified in one of the world's first civilizations.

### Bronze and Iron Age

          Dates are approximate, consult particular article for details
          Bronze Age Iron Age

## Classical period

The expanse of the Libyan Desert cut Egypt off from the rest of North Africa. Egyptian boats, while well suited to the Nile, were not usable in the open Mediterranean Sea. Moreover, the Egyptian merchant had far more prosperous destinations on Crete, Cyprus, and the Levant.
Greeks from Europe and the Phoenicians from Asia also settled along the coast of Northern Africa. Both societies drew their prosperity from the sea and from ocean-born trade. They found only limited trading opportunities with the native inhabitants, and instead turned to colonization. The Greek trade was based mainly in the Aegean, Adriatic, Black, and Red Seas and they only established major cities in Cyrenaica, directly to the south of Greece. In 332 BC, Alexander the Great conquered Egypt and for the next three centuries it was ruled by the Greek Ptolemaic dynasty.
The Phoenicians developed an even larger presence in North Africa with colonies from Tripoli to the Atlantic. One of the most important Phoenician cities was Carthage, which grew into one of the greatest powers in the region. At the height of its power, Carthage controlled the Western Mediterranean and most of North Africa outside of Egypt. However, Rome, Carthage's major rival to the north, defeated it in a series of wars known as the Punic Wars, resulting in Carthage's destruction in 146 BC and the annexation of its empire by the Romans. In 30 BC, Roman Emperor Octavian conquered Egypt, officially annexing it to the Empire and, for the first time, unifying the North African coast under a single ruler.
The Carthaginian power had penetrated deep into the Sahara ensuring the quiescence of the nomadic tribes in the region. The Roman Empire was more confined to the coast, yet routinely expropriated Berber land for Roman farmers. They thus faced a constant threat from the south. A network of forts and walls were established on the southern frontier, eventually securing the region well enough for local garrisons to control it without broader Imperial support.
When the Roman Empire began to collapse, North Africa was spared much of the disruption until the Vandal invasion of 429 AD. The Vandals ruled in North Africa until the territories were regained by Justinian of the Eastern Empire in the 6th century. Egypt was never invaded by the Vandals because there was a thousand-mile buffer of desert and because the Eastern Roman Empire was better defended.
During the rule of the Romans, Vandals, Byzantines, Carthaginians and the Ottomans the Kabyle people managed to maintain their independence. Still, after the Arab conquest of North Africa, the Kabyle people maintained the possession of their mountains.

## Arrival of Islam
### Arab Conquest

In the 7th century CE, the inception of Islam facilitated the unification of nomadic Arab tribes by bond of a common faith, preventing their historical internecine fighting along religious divisions.$^{:47–48}$ The main motivation for expansion was to spread Islam and convert pagans, with emphasis on the toleration of people practising other monotheistic or Abrahamic religions.$^{:56}$ Led by ingenious generals, the nascent Rashidun Caliphate centred in Medina won a series of crucial victories against the established powers in the Middle East, expanding in all directions, with the Byzantine's financial and military exhaustion from previous wars in the region inducing them to evacuate from Syria in 636 CE after only two years of conflict.$^{:47–48}$
With the regional Byzantine presence and power shattered, the Muslim armies turned towards Egypt and by 642 CE had conquered all of Egypt following the siege of Alexandria, generally facing little resistance by subjects odious of Roman rule.$^{:48}$ The subsequent rapid Islamization of Egypt has been attributed to people's dismay at the disruption caused by the Chalcedonian schism.$^{:59}$ Marching up the Nile, the Muslims launched a campaign against the Makurians but were repelled in battle, in a rare defeat owing to skilled Nubian archery and natural defences.
Their attention would then turn west to the Maghreb where the Exarchate of Africa had declared independence from Constantinople under Gregory the Patrician. The Muslims effortlessly annexed Ifriqiya (modern-day Libya) and in 647 CE defeated and killed Gregory and his army decisively in battle. Not wishing to annex the territory, they carried out raids across the decapitated state, and the populations, seeing they were at the Muslims' mercy, appealed to the general to pay a substantial tribute which was accepted.$^{:232}$ The Rashidun armies returned to Egypt and would again invade Makuria in 652 CE only to again be repelled in battle, leading them both to sign a treaty stipulating peace, which would dictate the relations between Egypt and Nubia for over seven centuries.$^{:81–82}$
Further expansion into North Africa waited another twenty years, due to the First Fitna, which led to the establishment of the Umayyad Caliphate, who moved the capital of the Muslim empire to Damascus, and its rule over the newly-conquered territories. In 670 CE, Uqba ibn Nafi al-Fihiri invaded what is now Tunisia in an attempt to take the region from the Byzantine Empire, but was only partially successful. He founded the town of Kairouan but was replaced by Abul-Muhajir Dinar in 674 CE. Abul-Muhajir successfully advanced into what is now eastern Algeria incorporating the Kingdom of Altava and Awraba tribe both ruled by Kusaila into the Islamic sphere of influence.$^{:29–30}$
In 681 CE Uqba was given command of the Arab forces again and advanced westward again in 682 CE, holding Kusaya as a hostage. He advanced to the Atlantic Ocean in the west and penetrated the Draa River Valley and the Sus region in what is now Morocco. However, Kusaila escaped during the campaign and attacked Uqba on his return and killed him near Biskra in what is now Algeria. After Uqba's death, the Arab armies retreated from Kairouan, which Kusaila took as his capital. He ruled there until he was defeated by an Arab army under Zuhair ibn Kays. This caused an epiphany among the Berber that this conflict was not just against the Byzantine's.$^{:236}$ Zuhair himself was killed in 688 CE while fighting against the Byzantine Empire which had reoccupied Cyrenaica while he was busy in Tunisia.$^{:30}$
In 693 CE, Caliph Abd al-Malik ibn Marwan sent an army of 40,000 men, commanded by Hasan ibn al-Nu'man, into Cyrenaica and Tripolitania to remove the Byzantine threat to the Umayyads advance in North Africa. They met no resistance until they reached Tunisia where they captured Carthage and defeated the Byzantines and Berbers around Bizerte.$^{:30–31}$
Soon afterwards, al-Nu'man's forces came into conflict with the Kingdom of the Aures and Jrāwa tribe both under the leadership of their queen, Al-Kahina. The Berbers defeated al-Nu'man in two engagements, the first on the river Nini and the second near Gabis, upon which al-Nu'man's forces retreated to Cyrenaica to wait for reinforcements. For five years this secured for Kahina the position of the uncontested ruler of the Maghreb until Arab reinforcements arrived in 703 CE and al-Nu'man advanced into what is now Tunisia, again meeting Al-Kahina near Gabis. This time he was successful and Al-Kahina retreated to Tubna where her forces were defeated and she was killed.$^{:31}$
Al-Nu'man next recaptured Carthage from the Byzantines, who had retaken it when he retreated from Tunisia. He founded the city of Tunis nearby and used it as the base for the Ummayad navy in the Mediterranean Sea. The Byzantines were forced to abandon the Maghreb and retreat to the islands of the Mediterranean Sea. However, in 705 CE he was replaced by Musa bin Nusair, a protégé of then governor of Egypt, Abdul-Aziz ibn Marwan. Nusair attacked what is now Morocco, captured Tangier, and advanced to the Sus river and the Tafilalt oasis in a three-year campaign.$^{:31–32}$

### Kharijite Berber Rebellion
## Abbasid rule and local dynasties

The Umayyads were overthrown in the east by the Abbasid Revolution, which replaced it with the Abbasid Caliphate. The Abbasids imposed their authority on Egypt and central North Africa as far west as Ifriqiya, but the regions further west of here remained beyond their control. These western regions were ruled by the local Berber tribes or other local dynasties, often adhering to either Sufri or Ibadi Kharijism.$^{:41}$

### Fatimids

The Fatimid Caliphate was established by Abu Abdallah al-Shi'i with the help Kutama Berbers from Little Kabylia after they conquered Ifriqiya from the Aghlabids. In 909 Abdallah al-Mahdi was enthroned as the first Fatimid Caliph in Ifriqiya. They went on to extend direct control or suzerainty over Egypt, varying extents of the Maghreb, Sicily, the Levant, and the Hijaz. In 969 the Fatimid army conquered Egypt and in 973 the Fatimid court was reinstalled in the new capital of Cairo, while government of the Maghreb was entrusted to the Zirids. After a long period of decline, the Fatimid Caliphate was eventually abolished by Salah ad-Din in 1171 and replaced in Egypt by the Ayyubid dynasty.

## Muslim Berber Empires
### Zirids

The Zirid Dynasty was a family of Sanhaja Berbers that were originally from the Kabyle mountains. Initially on behalf of the Fatimids, they ruled the eastern and central Maghreb but encountered more resistance to the west from local Zenata factions and the Umayyads of Cordoba.$^{:67,74–75}$ Sometime between 1041 and 1051 they renounced the suzerainty of the Fatimid caliphs in Cairo. The Fatimid retaliation came in the form of the invasions of the Banu Hilal and Banu Sulaym into the Maghreb.$^{:68–70}$

### Hammadids

The Hammadids came to power after declaring their independence from the Zirids in 1015.$^{:69}$ They managed to conquer land in all of the Maghreb region, capturing and possessing significant territories such as: Algiers, Bougie, Tripoli, Sfax, Susa, Fez, Ouargla and Sijilmasa. South of Tunisia, they also possessed a number of oasis that were the termini of trans-Saharan trade routes.

### Almoravids

In the 11th century, Berbers of the Sahara began a jihad to reform Islam in North Africa to impose what they saw as a more rigorously orthodox Maliki version of Islam. They were initially inspired by the teachings of Ibn Yasin and nominally recognized the suzerainty of the Abbasid Caliphs.$^{:76–80}$ This movement created an empire which, at its greatest extent, encompassed Al-Andalus (southern and eastern Iberia at the time) and roughly all of present-day Morocco and Western Sahara. This movement seems to have assisted the southern penetration of Africa, one that was continued by later groups. In addition, the Almoravids are traditionally believed to have attacked and brought about the destruction of the West African Ghana Empire. However, this interpretation has been questioned. Conrad and Fisher (1982) argued that the notion of any Almoravid military conquest at its core is merely perpetuated folklore, derived from a misinterpretation or naive reliance on Arabic sources while Dierke Lange agrees but argues that this doesn't preclude Almoravid political agitation, claiming that Ghana's demise owed much to the latter.

### Almohads

The Almohads were another religious and political movement that arose among the Berbers of the western Maghreb during the 12th century. They promoted a new fundamentalist and unorthodox/reformist version of Islam which recognized Ibn Tumart as a messianic figure, the Mahdi.$^{:246}$ After Ibn Tumart's death, the movement's political leadership passed on to 'Abd al-Mu'min, who overthrew the Almoravids and conquered the entire Maghreb and the remaining territories of Al-Andalus. Their empire disintegrated in the 13th century and was succeeded by three major states in North Africa: the Marinids in the western Maghreb, the Zayyanids in the central Maghreb, and the Hafsids in the eastern Maghreb (Ifriqiya).

### Hafsids

The Hafsids were a Masmuda Berber dynasty ruling Ifriqiya (modern Tunisia) from 1229 to 1574. Their territories stretched from east of modern Algeria to west of modern Libya during their zenith.
The dynasty was named after Muhammad bin Abu Hafs, a Berber from the Masmuda tribe of Morocco. He was appointed governor of Ifriqiya (present day Tunisia) by Muhammad an-Nasir, Caliph of the Almohad empire between 1198 and 1213. The Banu Hafs were a powerful group amongst the Almohads; their ancestor was Omar Abu Hafs al-Hentati, a member of the council of ten and a close companion of Ibn Tumart. His original name was "Fesga Oumzal", which later changed to "Abu Hafs Omar ibn Yahya al-Hentati" (also known as "Omar Inti") since it was a tradition of Ibn Tumart to rename his close companions once they had adhered to his religious teachings. The Hafsids as governors on behalf of the Almohads faced constant threats from Banu Ghaniya who were descendants of Almoravid princes which the Almohads had defeated and replaced as a ruling dynasty.
Hafsids were Ifriqiya governors of Almohads until 1229, when they declared independence. After the split of the Hafsids from the Almohads under Abu Zakariya (1229–1249), Abu Zakariya organised the administration in Ifriqiya (the Roman province of Africa in modern Maghreb; today's Tunisia, eastern Algeria and western Libya) and built Tunis up as the economic and cultural centre of the empire. At the same time, many Muslims from Al-Andalus fleeing the Spanish Reconquista of Castile, Aragon, and Portugal were absorbed. He also conquered Tlemcen in 1242 and took Abdalwadids as his vassal. His successor Muhammad I al-Mustansir (1249–1277) took the title of Caliph.
In the 14th century the empire underwent a temporary decline. Although the Hafsids succeeded for a time in subjugating the Kingdom of Tlemcen of the Abdalwadids, between 1347 and 1357 they were twice conquered by the Merinids of Morocco. The Abdalwadids however could not defeat the Bedouin; ultimately, the Hafsids were able to regain their empire. During the same period plague epidemics caused a considerable fall in population, further weakening the empire. Under the Hafsids, commerce with Christian Europe grew significantly, however piracy against Christian shipping grew as well, particularly during the rule of Abd al-Aziz II (1394–1434). The profits were used for a great building programme and to support art and culture. However, piracy also provoked retaliation from Aragon and Venice, which several times attacked Tunisian coastal cities. Under Utman (1435–1488) the Hafsids reached their zenith, as the caravan trade through the Sahara and with Egypt was developed, as well as sea trade with Venice and Aragon. The Bedouins and the cities of the empire became largely independent, leaving the Hafsids in control of only Tunis and Constantine.
In the 16th century the Hafsids became increasingly caught up in the power struggle between Spain and the Ottoman Empire-supported Corsairs. Ottomans conquered Tunis in 1534 and held one year. Due to Ottoman threat, Hafsids were vassal of Spain after 1535. Ottomans again conquered Tunis in 1569 and held it for 4 years. Don Juan of Austria recaptured it in 1573. The latter conquered Tunis in 1574 and the Hafsids accepted becoming a Spanish vassal state to offset the Ottoman threat. Muhammad IV, the last Caliph of the Hafsids was brought to Constantinople and was subsequently executed due to his collaboration with Spain and the desire of the Ottoman Sultan to take the title of Caliph as he now controlled Mecca and Medina. The Hafsid lineage survived the Ottoman massacre by a branch of the family being taken to the Canary Island of Tenerife by the Spanish.

### Wattasids
## Ottoman rule

After the Middle Ages, Northern Africa was loosely under the control of the Ottoman Empire, except for the Kabyle people and Moroccan region ruled by Saadi Sultanate. Ottoman rule was centered on the cities of Algiers, Tunis, and Tripoli.

## European colonial period

During the 18th and 19th century, North Africa was colonized by France, the United Kingdom, Spain and Italy. During the 1950s and 1960s, and into the 1970s, all of the North African states gained independence from their colonial European rulers, except for a few small Spanish colonies on the far northern tip of Morocco, and parts of the Sahara region, which went from Spanish to Moroccan rule.
In modern times the Suez Canal in Egypt (constructed in 1869) has caused a great deal of controversy. The Convention of Constantinople in 1888 declared the canal a neutral zone under the protection of the British, after British troops had moved in to protect it in 1882. Under the Anglo-Egyptian Treaty of 1936, the United Kingdom insisted on retaining control over the canal. In 1951 Egypt repudiated the treaty, and by 1954 Great Britain had agreed to pull out.
After the United Kingdom and the United States withdrew their pledge to support the construction of the Aswan Dam, President Gamal Abdel Nasser nationalized the canal, which led Britain, France and Israel to invade in the week-long Suez War. As a result of damage and sunken ships, the canal was closed until April 1957, after it had been cleaned up with UN assistance. A United Nations force (UNEF) was established to maintain the neutrality of the canal and the Sinai Peninsula.

## Europe and the Maghreb

In the 1960's, the European Economic Community (later becoming the European Union), developed an economic and sociopolitical relationship with the Maghreb states. The treaty of Rome demonstrated this by inviting Morocco and Tunisia to create an agreement between these countries and the EEC. This cemented Maghreb nations trading with Europe and the EEC to overall influence their growth. Trading between Europe and Maghreb gradually increased, leading to the creation of the Global Mediterranean Policy, in 1972. This policy lasted until 1992. However, there was little financial benefit that this policy created for both parties.

### Complications

The growth of the EEC called for more restrictive measures for trading with Maghreb due to security concerns. European strife also contributed to lack of trading between regions, with the Berlin wall falling and overall a necessity to draw their focus away from Maghreb. Maghreb had to deal with their own internal conflicts as well, as the 2nd Gulf War in 1991 caused sociopolitical turmoil without the states. While trading still occurs between these two parties, the Global Mediterranean policy was viewed as an overall disappointment.

## Post-colonial period

In World War II from 1940 to 1943 the area was the setting for the North African Campaign. During the 1950s and 1960s, all of the North African states gained independence. There remains a dispute over Western Sahara between Morocco and the Algerian-backed Polisario Front.
The wider protest movement known as the Arab Spring began with revolutions in Tunisia and Egypt which ultimately led to the overthrow of their governments, as well as civil war in Libya. Large protests also occurred in Algeria and Morocco to a lesser extent. Many hundreds died in the uprisings.

## History of North African Architecture

Further information in the sections of Architecture of Africa:
* Prehistoric North African Architecture
* Ancient North African Architecture
* Medieval North African Architecture

## History of science and technology in North Africa

Further information in the sections of History of science and technology in Africa:
* Education
* Astronomy
* Mathematics
* Metallurgy
* Medicine
* Agriculture
* Textiles
* Maritime technology
* Architecture
* Communication systems
* Warfare
* Commerce
* By country

## Genetic history of North Africa
### Archaic Human DNA

While Denisovan and Neanderthal ancestry in non-Africans outside of Africa are more certain, archaic human ancestry in Africans is less certain and is too early to be established with certainty.

### Ancient DNA
#### Egypt

Amenhotep III, Akhenaten, and Tutankhamen carried haplogroup R1b. Thuya, Tiye, Tutankhamen's mother, and Tutankhamen carried haplogroup K.
Ramesses III and Unknown Man E, possibly Pentawere, carried haplogroup E1b1a.
Khnum-aa, Khnum-Nakht, and Nakht-Ankh carried haplogroup M1a1.

#### Libya

At Takarkori rockshelter, in Libya, two naturally mummified women, dated to the Middle Pastoral Period (7000 BP), carried basal haplogroup N.

#### Morocco

The Taforalts of Morocco, who were found to be 63.5% Natufian, were also found to be 36.5% Sub-Saharan African (e.g., Hadza), which is drawn out, most of all, by West Africans (e.g., Yoruba, Mende). In addition to having similarity with the remnant of a more basal Sub-Saharan African lineage (e.g., a basal West African lineage shared between Yoruba and Mende peoples), the Sub-Saharan African DNA in the Taforalt people of the Iberomaurusian culture may be best represented by modern West Africans (e.g., Yoruba).

### Mitochondrial DNA

Mitochondrial haplogroups L3, M, and N are found among Sudanese peoples (e.g., Beja, Nilotics, Nuba, Nubians), who have no known interaction (e.g., history of migration/admixture) with Europeans or Asians; rather than having developed in a post-Out-of-Africa migration context, mitochondrial macrohaplogroup L3/M/N and its subsequent development into distinct mitochondrial haplogroups (e.g., Haplogroup L3, Haplogroup M, Haplogroup N) may have occurred in East Africa at a time that considerably predates the Out-of-Africa migration event of 50,000 BP.

### Medical DNA
#### Lactase Persistence

Neolithic agriculturalists, who may have resided in Northeast Africa and the Near East, may have been the source population for lactase persistence variants, including –13910*T, and may have been subsequently supplanted by later migrations of peoples. The Sub-Saharan West African Fulani, the North African Tuareg, and European agriculturalists, who are descendants of these Neolithic agriculturalists, share the lactase persistence variant –13910*T. While shared by Fulani and Tuareg herders, compared to the Tuareg variant, the Fulani variant of –13910*T has undergone a longer period of haplotype differentiation. The Fulani lactase persistence variant –13910*T may have spread, along with cattle pastoralism, between 9686 BP and 7534 BP, possibly around 8500 BP; corroborating this timeframe for the Fulani, by at least 7500 BP, there is evidence of herders engaging in the act of milking in the Central Sahara.