Abd Elkader led the resistance for 15 years and initially made great progress by liberating the western provinces of Algeria and setting up a state with its own currency "the muhammadiya" and administrative departments.
Despite the French army's savagery Emir Abd Elkader fought within the confines of Islamic warfare, strictly adhering to its rules and principles. Long before the Geneva conventions of the treatment of prisoners of war, he issued the following edict: "Every Arab who captures alive a French soldier will receive as reward eight douros. Every Arab who has in his possession a Frenchman is bound to treat him well and to take him to either his commander or the Emir himself, as soon as possible. In cases where the prisoner complains of ill treatment, the Arab will have no right to any reward." When asked what the reward was for a severed French head, the Emir replied "twenty-five blows of the baton on the soles of the feet".
Abd Elkader made sure his prisoners were protected against violent reprisals on the part of outraged tribesmen seeking to avenge loved ones. He also invited a Christian priest to minister to their religious needs. In a letter to Dupuch, Bishop of Algeria, with whom he had entered into negotiations regarding prisoners generally, he wrote "Send a priest to my camp, he will lack nothing". In one instance he even freed prisoners when he did not have enough food for them.
Likewise, as regards female prisoners, he exercised the most sensitive treatment, having them placed under the protective care of his mother, lodging them in a tent permanently guarded against any would be molesters. It is hardly surprising that some of these prisoners of war embraced Islam, while others, once they were freed, sought to remain with the Emir and serve under him.
The Emir's humane treatment of French prisoners was kept secret from the French forces; had it leaked out, the result would have been devastating for the morale of the French forces, who had been told that they were fighting a war for the sake of civilization, and that their adversaries were barbarians. As Colonel Gery confided in the Bishop of Algeria, "We are obliged to try as hard as we can to hide these things [the treatment accorded French prisoners by the Emir] from our soldiers. For if they so much as suspected such things, they would not hasten with such fury against Abd el-Kader."
After 15 years of fierce resistance against one of the most advanced armies of the time, the emir was at last defeated and in 1847 he negotiated his surrender in exchange for exile in Egypt. But the French didn't keep their word and instead sent him to prison in France. There he learned French and studied the works of Greek and Muslim philosophers. He later wrote his first book "Call to the Intelligent". Hundreds of French admirers who had heard of his bravery and his nobility visited him and he was most deeply touched by the French officers who came to thank him for the treatment they received at his hands when they were his prisoners in Algeria.