After the Invasion of Algiers in 1830, the French encountered resistance from the population who pledged allegiance to Emir Abdelkader, who established a caliphate in Miliana in 1835. The Peace Treaty of Desmichels guaranteed Emir Abdelkader the right to take possession of Miliana starting in 1835 where he was warmly welcomed by the city's general population and prominent citizens.