When Almohade dynasty fell apart in the mid-1200s did the Maghreb region, in practice the four-division which still exists, with the states Morocco, Algeria, Tunisia and Libya – all with autonomy within the Ottoman Empire. This was reinforced, with today’s borders, under French colonial rule and influence in the three westernmost countries. For Algeria, today’s borders came under French colonial rule, which followed the Ottoman rule of 1830.
During the Napoleonic Wars, Alger exported food to France, which was indebted to the Algerian dey. When Hussein dey in 1827 demanded that the debt be repaid from 1798, an episode took place with the dey and the French consul, where the latter must have been beaten by the ruler, who would not regret the incident. King Charles 10 then used it as a pretext to break diplomatic relations, and introduced a three-year naval blockade, which the dey replied with destroying French trading stations.
After the end of the Napoleonic wars in 1815, Alger came to war with several European states. In 1816, Algeria was attacked by Britain and the Netherlands.
On July 5, 1830, France invaded Alger with a force of about 37,000 men. The punitive action initiated an occupation and colonization that lasted to Algeria’s independence in 1962. The occupation – and later colonization – was initially unintentional, and was just as much grounded in internal political conditions in France as a desire to submit to Algeria.
The Istanbul Sultan did not want to interfere with the conflict. Muhammad Ali, ruler of Egypt, was offered to take over Algeria within the Ottoman Empire, but refused. A planned transfer of Constantine in eastern Algeria to the dey of Tunisia was also not completed. The last Ottoman dey, Husein, therefore surrendered Alger to the French, and went into exile. France also occupied Oran in the west in 1831 and Bejaïa in the east in 1833. Despite the agreement with the dey, the French took over private property and religious buildings, as well as agricultural lands. Thus also began a struggle against French rule which took various forms – until Algeria became independent in 1962.
The French July Revolution, which in 1830 deposed King Karl 10, led the invaders to come to power in France. However, this did not lead to French withdrawal from Algeria; neither did the Algerian resistance. In western Algeria, Abd el-Kader (Abd al-Qadir ibn Muhyi al-Din) led around 12,000 men in battle against the French in 1832. He controlled most of western and central Algeria; the French held Alger. In Constantine, the Bey, Hajj Ahmed, remained in power, claiming in 1834 to rule the entire country as a successor to the departed dey.
El-Kader declared jihad – a holy war – against the invaders, before in 1834 he signed a peace treaty with General Louis Alexis Desmichels on behalf of France, and was given the title emir. The French then supplied him with weapons, and el-Kader defeated the Beyen in Oran the same year. The agreement was available in two versions; one more far-reaching in Arabic, another in French. Only the last became known to the Paris government, and this led to misunderstandings and clashes that led to a new war in 1835.
French military leaders in Algeria launched several unsuccessful expeditions, in part contrary to the political signals from Paris, which advocated a limited occupation, limited to Alger, Oran and Bône – and their surrounding areas. By the way, France would hand over the power to five local leaders, who would be kept in check through a divisive and ruling policy.
One of these was Abd al-Qadir (Abd el-Kader), which was made a beylik by Titteri. As a result of a peace treaty signed in 1837, he was granted control over two-thirds of Algeria, where he established his own state. The agreement was broken by both parties, including fierce fighting in southern Constantine, which El-Kadar’s forces captured before French forces struck them back.
A new ceasefire led to al-Qadir’s expansion of state formation by fighting local tribes, driving Hajj Ahmad out of Constantine. In 1840 he declared war again, and France strengthened its military presence in Algeria to over 100,000 soldiers. With this force, France waged a systematic campaign, including Mascara and Tlemcen, and defeated Abd al-Qadir, who in 1843 sought refuge in Morocco. From there he continued the fight, partly with military Moroccan support.
After fighting between French and Moroccan forces in 1844, an agreement was made in Tangier, which then defined the border between Algeria and Morocco. Abd al-Qadir participated in an attack on Oran in 1845, but was beaten back. He then got into a clamp between Morocco and the French government in Algeria, and surrendered in 1847. By then he had been attacked by Moroccan forces and expelled from the country. He was first imprisoned in France; then banished to Syria. In 1848, Hajj Ahmad also surrendered. Thus, around 1850, France had military control over all of Algeria with the exception of Kabylia, which was captured in 1857.
As a result of opposition to the French invasion, and early state-building, Abd al-Qadir is often regarded as the symbolic founder of the Algerian nation. The French occupation of the entire coastal region between Morocco in the west and Tunisia in the east helped for the first time to consolidate this part of Algeria under one real leadership. As a result of the invasion and fighting, Algeria was severely weakened economically and culturally; large parts of the country were destroyed.