Photo from Algeria
In the region of Ain Hanech (Saïda Province), early remnants (200,000 BC) of hominid occupation in North Africa were found. Neanderthal tool makers produced hand axes in the Levalloisian and Mousterian styles (43,000 BC) similar to those in the Levant.
Algeria was the site of the highest state of development of Middle Paleolithic Flake tool techniques. Tools of this era, starting about 30,000 BC, are called Aterian (after the archeological site of Bir el Ater, south of Tebessa).
The earliest blade industries in North Africa are called Iberomaurusian (located mainly in Oran region). This industry appears to have spread throughout the coastal regions of the Maghreb between 15,000 and 10,000 BC. Neolithic civilization (animal domestication and agriculture) developed in the Saharan and Mediterranean Maghreb perhaps as early as 11,000 BC or as late as between 6000 and 2000 BC. This life, richly depicted in the Tassili n'Ajjer paintings, predominated in Algeria until the classical period.
The amalgam of peoples of North Africa coalesced eventually into a distinct native population that came to be called Berbers, who are the indigenous peoples of northern Africa.
From their principal centre of power at Carthage, the Carthaginian expanded and established small settlements along the North African coast; by 600 BC, a Phoenician presence existed at Tipasa, east of Cherchell, Hippo Regius (modern Annaba) and Rusicade (modern Skikda). These settlements served as market towns as well as anchorages.
As Carthaginian power grew, its impact on the indigenous population increased dramatically. Berber civilization was already at a stage in which agriculture, manufacturing, trade, and political organization supported several states. Trade links between Carthage and the Berbers in the interior grew, but territorial expansion also resulted in the enslavement or military recruitment of some Berbers and in the extraction of tribute from others.
By the early 4th century BC, Berbers formed the single largest element of the Carthaginian army. In the Revolt of the Mercenaries, Berber soldiers rebelled from 241 to 238 BC after being unpaid following the defeat of Carthage in the First Punic War. They succeeded in obtaining control of much of Carthage's North African territory, and they minted coins bearing the name Libyan, used in Greek to describe natives of North Africa. The Carthaginian state declined because of successive defeats by the Romans in the Punic Wars.
In 146 BC the city of Carthage was destroyed. As Carthaginian power waned, the influence of Berber leaders in the hinterland grew. By the 2nd century BC, several large but loosely administered Berber kingdoms had emerged. Two of them were established in Numidia, behind the coastal areas controlled by Carthage. West of Numidia lay Mauretania, which extended across the Moulouya River in modern-day Morocco to the Atlantic Ocean. The high point of Berber civilization, unequaled until the coming of the Almohads and Almoravids more than a millennium later, was reached during the reign of Massinissa in the 2nd century BC.
After Masinissa's death in 148 BC, the Berber kingdoms were divided and reunited several times. Massinissa's line survived until 24 AD, when the remaining Berber territory was annexed to the Roman Empire.
For several centuries Algeria was ruled by the Romans, who founded many colonies in the region. Like the rest of North Africa, Algeria was one of the breadbaskets of the empire, exporting cereals and other agricultural products. Saint Augustine was the bishop of Hippo Regius (modern-day Algeria), located in the Roman province of Africa. The Germanic Vandals of Geiseric moved into North Africa in 429, and by 435 controlled coastal Numidia. They did not make any significant settlement on the land, as they were harassed by local tribes, in fact by the time the Byzantines arrived Lepcis Magna was abandoned and the Msellata region was occupied by the indigenous Laguatan who had been busy facilitating an Amazigh political, military and cultural revival.
After negligible resistance from the locals, the Arabs conquered Algeria in the mid-7th century and a large number of the indigenous people converted to the new faith. After the fall of the Umayyad Caliphate, numerous local dynasties emerged, including the Aghlabids, Almohads, Abdalwadid, Zirids, Rustamids, Hammadids, Almoravids and the Fatimids.
During the Middle Ages, North Africa was home to many great Scholars, Saints and Sovereigns including Judah Ibn Quraysh the first grammarian to suggest the Afroasiatic language family, the great Sufi masters Sidi Boumediene (Abu Madyan) and Sidi El Houari, as well as the Emirs Abd Al Mu'min and Yāghmūrasen. It was during this time period that the Fatimids or children of Fatima, daughter of Muhammad, came to the Maghreb. These "Fatimids" went on to found a long lasting dynasty stretching across the Maghreb, Hejaz, and the Levant, boasting a secular inner government, as well as a powerful army and navy, primarily made of Arabs and levantians extending from Algeria to their capital state of Cairo. The Fatimid caliphate began to collapse when its governors the Zirids seceded. In order to punish them the Fatimids sent the Arab Banu Hilal and Banu Sulaym against them. The resultant war is recounted in the epic Tāghribāt. In Al-Tāghrībāt the Amazigh Zirid Hero Khālīfā Al-Zānatī asks daily, for duels, to defeat the Hilalan hero Ābu Zayd al-Hilalī and many other Arab knights in a string of victories. The Zirids however were ultimately defeated ushering in an adoption of Arab customs and culture. The indigenous Amazigh tribes however remained largely independent, and depending on tribe, location, and time controlled varying parts of the Maghreb, at times unifying it (as under the Fatimids). The Fatimid Islamic state, also known as Fatimid Caliphate made an Islamic empire that included North Africa, Sicily, Palestine, Jordan, Lebanon, Syria, the Red Sea coast of Africa, Tihamah, Hejaz, and Yemen. Caliphates from Northern Africa traded with the other empires of their time, as well as forming part of a confederated support and trade network with other Islamic states during the Islamic Era.
The Amazighs historically consisted of several tribes. The two main branches were the Botr and Barnès tribes, who were divided into tribes, and again into sub-tribes. Each region of the Maghreb contained several tribes (for example, Sanhadja, Houaras, Zenata, Masmouda, Kutama, Awarba, and Berghwata). All these tribes made independent territorial decisions.
Several Amazigh dynasties emerged during the Middle Ages in the Maghreb and other nearby lands. Ibn Khaldun provides a table summarizing the Amazigh dynasties of the Maghreb region, the Zirid, Banu Ifran, Maghrawa, Almoravid, Hammadid, Almohad, Merinid, Abdalwadid, Wattasid, Meknassa and Hafsid dynasties.
In the early 16th century, Spain constructed fortified outposts (presidios) on or near the Algerian coast. Spain took control of few coastal towns like Mers el Kebir in 1505; Oran in 1509; and Tlemcen, Mostaganem, and Ténès, in 1510. In the same year, few merchants of Algiers ceded one of the rocky islets in their harbour to Spain, which built a fort on it. The presidios in North Africa turned out to be a costly and largely ineffective military endeavour that did not guarantee access for Spain's merchant fleet.