In the 7th century, Arabs invaded Algeria and the country’s territory became part of the Arab Caliphate. Islamization occurred (and later – Arabization) of Algeria.
In 761–909, the Ibadi state of Rustamides existed on the territory of Algeria. After its fall, the Ibadites settled in the Mzab area.
In the X century, Algeria was ruled by the Fatimids. But in 971, the Fatimid caliph Al-Mu’izz li-Din Allah appointed Buluggin ibn Ziri as governor of Ifrikiya (North Africa), and from 972 Buluggin, formally remained the governor of the Fatimids. The capital of the state Ziridov became Kairouan. At the same time, in 944, Buluggin ibn Ziri founded the city of Al-Jazair ( Spanish Argel ; now the capital of the state is Algiers).
In 1014, Hammad ibn Buluggin , who was governor of the Maghreb, declared independence from the ruling dynasty of Zyrids. Since most of the Maghreb from Morocco to Tunisia was under his rule, he soon received recognition from Caliph Baghdad of the Abbasid dynasty. The Zirids sent an army to fight Hammad, but were defeated, and two years later, in 1018, peace was signed, thereby recognizing Hammad ibn Bologgin as the legal ruler.
Hammad founded the new capital of Cala Beni Hammad. Under pressure from the Bedouin tribe Banu Hilyal, who were sent to the countries of the Maghreb by the Fatimids, the Hammadid dynasty was forced to move to Bejaia. The Bedouins, who came from the east in 1062, destroyed crops, villages, entire cities, killed men and forcibly took the local women as wives. This accelerated the Arabization of the Algerian population, much of which has since been spoken in Bedouin Arabic dialects.
In 1082, west of Algeria was captured by nomadic Berbers from the Sahara, led by the Almoravids. But the Hammadids with the help of the Bedouins repelled their invasion, retaining the east of the country.
In 1152, the Caliph of the Almohad dynasty, Abd al-Mumin, captured Kala, Bejay and annexed the Hammadids to his country.
Almohads ruled until 1269, after which the country fell apart into several states. An independent state formed under the rule of Zayanids (Abdalvadis) in Tlemcen, and the cities of Algeria, Oran, Bougie, Tenes became independent possessions, later, however, obliged to pay tribute to the kingdom of Tlemcen.
Exiled from Spain in 1492, the Moors and Jews settled in Algeria and began to indulge in piracy. As a result, the king of Aragon Ferdinand II attacked them, conquered Bougie in 1506, and in 1509 Oran and the city of Algeria.
But when the Spaniards even threatened Emir Metigi from here, Salam al-Toumi invited Turkish marque Oruç Barbarossa to help him free himself from the power of the Spaniards. This was the beginning of the rule of the Ottomans over Algeria, which has since come to an ever greater decline. Oruç appeared in Algeria in 1516, but soon, together with his corsairs, he came out against Salam al-Toumi himself, killed him and proclaimed himself the Sultan of Algeria. Following this, he defeated the sultans of Tenes and Tlemcen and captured their provinces. In 1517, the Spanish army under the command of Marquis of Gomarets from Oran (who was Spanish at the time) defeated Oruç in several battles and besieged him in Tlemcen; when he tried to flee from there, he was seized by the Spaniards and beheaded in 1518. The Ottoman pirates who remained in Algeria then proclaimed the brother of Oruç, Hayreddin Barbarossa as sultan, but the latter, not feeling strong enough to resist the Spaniards, gave his state to the Ottoman sultan Selim I in 1520, who appointed him plow and supplied him significant reinforcements, through which the Spaniards were expelled from the country. Algeria, in its modern borders, became a province of the Ottoman Empire, divided into three Beylikas: Constantine, Titteri ( Medea ) and Mascara (Oran). Haird-ad-Din, thanks to his courage, deceit and cruelty, established the system of military despotism and maritime robbery, which prevailed in Algeria until 1530.
His successor was Hassan-agha. Emperor Charles V of Habsburg tried to put an end to the increasingly piracy of the Algerians. On October 20, 1541, he landed in the Bay of Algiers with a fleet of 370 ships, 20,000 infantry and 6,000 horsemen; but a terrible storm, accompanied by an earthquake and heavy rain, destroyed most of the fleet and camp on October 24 . The land forces without food, shelter and fortifications had to spend several days on the enemy shore. Only on October 27, the Spaniards, having lost 14 military and 150 transport ships, 8,000 soldiers and 300 officers, were able to sail to Spain. The new storm dispersed the fleet again; the emperor was supposed to seek refuge in Bougie, and only on November 25, he sailed to Majorca with the remnants of the fleet and army.
Under the successors of Hassan, Algerians made naval attacks on Christian states and often even landed on the shores of Spain and Italy. Piracy, which flourished on the coast of Algeria, caused European monarchs to conduct a number of marine and amphibious expeditions against Algeria – the so-called Algerian expeditions. On land, Algerian pirates also fought endless wars with neighboring states. Even before the end of the XVI century, the Algerian pasha conquered the entire western part of the country to the border with Morocco, with the exception of Oran, which remained in the hands of the Spaniards. In the east, the Bougie, which the Spaniards owned for 35 years, was taken by the Ottomans in 1554, and in the south, their possession of our Algerian plow extended to the desert. The repeated attempts of the Spaniards to seize the western provinces of this predatory state always ended in failure; in 1561, the whole Spanish army led by the Comte de Acodato was destroyed at Mostaghanem.
In 1600, the Ottoman army Janissaries in Algeria, in Constantinople, secured themselves permission to choose from among their ranks a deed that was supposed to share power with Pasha and be their superior. The consequence of this dual power were frequent internal strife. After the Algerians attacked the shores of Provence, the French king Louis XIV three times undertook campaigns to punish them for it. For the first time, on July 25, 1682, the French admiral Duquesne, with 25 military vessels, began to bombard the city of Algeria, and the dey responded by loading one gun with the French consul Vasher and firing it into the French fleet. The secondary bombardment undertaken by the French on June 28, 1683, with 23 ships, destroyed the lower city and led to the release of the captive Christian slaves, but had no other consequences, so that in 1687 the French government found it necessary to undertake a third campaign against the Algerians. On June 26 of the same year, the French fleet under the command of Marshal d’Estrées again bombarded the city of Algeria and burned six warships. Half of the city was turned into a pile of ruins, but it did not help either. The attack of English Admiral Blake in 1655, as well as the shelling of the city in 1669 and 1670, by the English and Dutch fleets also remained without consequences; nevertheless, the British first of Europeans began to conclude contracts with acts (since 1662).
The history of Algeria in the new and modern times / R. G. Landa