structural:expansion
Early success (1830–1837)

In 1830, Algeria was invaded by France; French colonial domination over Algeria eventually supplanted domination by the Ottoman Empire and the Kouloughlis. There was a lot of pent-up resentment against the Ottomans when the French arrived, and due to numerous rebellions in the early 19th century, the Algerians could not oppose the French at all initially. When the French Africa Army reached Oran in January 1831, Abdelkader's father was asked to lead a resistance campaign against them; Muhieddine called for jihad and he and his son were among those involved in early attacks below the walls of the city.

It was at this point that Abdelkader came to the fore. At a meeting of the western tribes in the autumn of 1832, he was elected Amir al-Mu'minin (typically abbreviated to "Emir") following his father's refusal of the position on the grounds that he was too old. The appointment was confirmed five days later at the Great Mosque of Mascara. Within a year, through a combination of punitive raids and careful politics, Abdelkader had succeeded in uniting the tribes in the region and in reestablishing security – his area of influence now covered the entire Province of Oran. The local French commander-in-chief, General Louis Alexis Desmichels, saw Abdelkader as the principal representative of the area during peace negotiations, and in 1834 they signed the Desmichels Treaty, which ceded near-total control of Oran Province to Abdelkader. For the French, this was a way of establishing peace in the region while also confining Abdelkader to the west; but his status as a co-signatory also did much to elevate him in the eyes of the Berbers and of the French.

Using this treaty as a start, he imposed his rule on the tribes of the Chelif, Miliana, and Médéa. The French high command, unhappy with what they now saw as the unfavorable terms of the Desmichels Treaty, recalled General Desmichels and replaced him with General Camille Alphonse Trézel, which caused a resumption of hostilities. Abdelkader's tribal warriors met the French forces in July 1834 at the Battle of Macta, where the French suffered an unexpected defeat.

France's response was to step up its military campaign, and under new commanders the French won several important encounters including the 1836 Battle of Sikkak. But political opinion in France was becoming ambivalent towards Algeria, and when General Thomas Robert Bugeaud was deployed to the region in April 1837, he was "authorized to use all means to induce Abd el-Kader to make overtures of peace". The result, after protracted negotiations, was the Treaty of Tafna, signed on 30 May 1837. This treaty gave even more control of interior portions of Algeria to Abdelkader but with the recognition of France's right to imperial sovereignty. Abdelkader thus won control of all of Oran Province and extended his reach to the neighbouring province of Titteri and beyond.