The French faced other opposition as well in the area.
The superior of a religious brotherhood, Muhyi ad Din, who had spent time in Ottoman jails for opposing the bey's rule, launched attacks against the French and their makhzen allies at Oran in 1832.
In the same year, jihad was declared and to lead it tribal elders chose Muhyi ad Din's son, twenty-five-year-old Abd al Qadir.
Abd al Qadir, who was recognized as Amir al-Muminin (commander of the faithful), quickly gained the support of tribes throughout Algeria.
A devout and austere marabout, he was also a cunning political leader and a resourceful warrior.
From his capital in Tlemcen, Abd al Qadir set about building a territorial Muslim state based on the communities of the interior but drawing its strength from the tribes and religious brotherhoods.
By 1839, he controlled more than two-thirds of Algeria.
His government maintained an army and a bureaucracy, collected taxes, supported education, undertook public works, and established agricultural and manufacturing cooperatives to stimulate economic activity.

The French in Algiers viewed with concern the success of a Muslim government and the rapid growth of a viable territorial state that barred the extension of European settlement.
Abd al Qadir fought running battles across Algeria with French forces, which included units of the Foreign Legion, organized in 1831 for Algerian service.
Although his forces were defeated by the French under General Thomas Bugeaud in 1836, Abd al Qadir negotiated a favorable peace treaty the next year.
The treaty of Tafna gained conditional recognition for Abd al Qadir's regime by defining the territory under its control and salvaged his prestige among the tribes just as the shaykhs were about to desert him.
To provoke new hostilities, the French deliberately broke the treaty in 1839 by occupying Constantine.
Abd al Qadir took up the holy war again, destroyed the French settlements on the Mitidja Plain, and at one point advanced to the outskirts of Algiers itself.
He struck where the French were weakest and retreated when they advanced against him in greater strength.
The government moved from camp to camp with the amir and his army.
Gradually, however, superior French resources and manpower and the defection of tribal chieftains took their toll.
Reinforcements poured into Algeria after 1840 until Bugeaud had at his disposal 108,000 men, one-third of the French army.

One by one, the amir's strongholds fell to the French, and many of his ablest commanders were killed or captured so that by 1843 the Muslim state had collapsed.

Abd al Qadir took refuge in 1841 with his ally, the sultan of Morocco, Abd ar Rahman II, and launched raids into Algeria.
This alliance led the French Navy to bombard and briefly occupy Essaouira (Mogador) under the Prince de Joinville on August 16, 1844.
A French force was destroyed at the Battle of Sidi-Brahim in 1845.
However, Abd al Qadir was obliged to surrender to the commander of Oran Province, General Louis de Lamoricière, at the end of 1847.

Abd al Qadir was promised safe conduct to Egypt or Palestine if his followers laid down their arms and kept the peace.
He accepted these conditions, but the minister of war — who years earlier as general in Algeria had been badly defeated by Abd al Qadir — had him consigned in France in the Château d'Amboise.
The French faced other opposition as well in the area. The superior of a religious brotherhood, Muhyi ad Din, who had spent time in Ottoman jails for opposing the bey's rule, launched attacks against the French and their makhzen allies at Oran in 1832. In the same year, jihad was declared and to lead it tribal elders chose Muhyi ad Din's son, twenty-five-year-old Abd al Qadir. Abd al Qadir, who was recognized as Amir al-Muminin (commander of the faithful), quickly gained the support of tribes throughout Algeria. A devout and austere marabout, he was also a cunning political leader and a resourceful warrior. From his capital in Tlemcen, Abd al Qadir set about building a territorial Muslim state based on the communities of the interior but drawing its strength from the tribes and religious brotherhoods. By 1839, he controlled more than two-thirds of Algeria. His government maintained an army and a bureaucracy, collected taxes, supported education, undertook public works, and established agricultural and manufacturing cooperatives to stimulate economic activity.
The French in Algiers viewed with concern the success of a Muslim government and the rapid growth of a viable territorial state that barred the extension of European settlement. Abd al Qadir fought running battles across Algeria with French forces, which included units of the Foreign Legion, organized in 1831 for Algerian service. Although his forces were defeated by the French under General Thomas Bugeaud in 1836, Abd al Qadir negotiated a favorable peace treaty the next year. The treaty of Tafna gained conditional recognition for Abd al Qadir's regime by defining the territory under its control and salvaged his prestige among the tribes just as the shaykhs were about to desert him. To provoke new hostilities, the French deliberately broke the treaty in 1839 by occupying Constantine. Abd al Qadir took up the holy war again, destroyed the French settlements on the Mitidja Plain, and at one point advanced to the outskirts of Algiers itself. He struck where the French were weakest and retreated when they advanced against him in greater strength. The government moved from camp to camp with the amir and his army. Gradually, however, superior French resources and manpower and the defection of tribal chieftains took their toll. Reinforcements poured into Algeria after 1840 until Bugeaud had at his disposal 108,000 men, one-third of the French army.
One by one, the amir's strongholds fell to the French, and many of his ablest commanders were killed or captured so that by 1843 the Muslim state had collapsed.
Abd al Qadir took refuge in 1841 with his ally, the sultan of Morocco, Abd ar Rahman II, and launched raids into Algeria. This alliance led the French Navy to bombard and briefly occupy Essaouira (Mogador) under the Prince de Joinville on August 16, 1844. A French force was destroyed at the Battle of Sidi-Brahim in 1845. However, Abd al Qadir was obliged to surrender to the commander of Oran Province, General Louis de Lamoricière, at the end of 1847.
Abd al Qadir was promised safe conduct to Egypt or Palestine if his followers laid down their arms and kept the peace. He accepted these conditions, but the minister of war — who years earlier as general in Algeria had been badly defeated by Abd al Qadir — had him consigned in France in the Château d'Amboise.
French Algeria