Ahmed bin Ali Khodja

Ahmed bin Ali Khodja, also known as Ahmed II was the Dey (Sultan) of Algiers between 1805 and 1808 (1220 to 1223 of the Hijrī). He came to power after assassinating the previous Dey, Mustapha II and his close friend and associate, Boudjenah with the help of the janissaries of the Odjak of Algiers. The fall of Mustapha, and Ahmed's coming to power resulted in the Odjak's influence severely overinflating and severe instability for the next 10 years. Corruption became rampant in the country, and the Odjak became a sort of ruthless kingmaker council, and forced Ahmed and the next few upcoming Deys to bow to any will they had. Just in the first 30 days of his rule, he looted the property of the Jewish residents of Algiers, and committed several and massacres. His rule was marked with many revolts, from Kabyle tribes, Arab tribes, Darqawiyya Sufis, and even the population of Tlemcen. His unpopularity rapidly increased after sustaining a severe defeat in 1807 by the Tunisians resulting in Tunis losing any sort of Algerian influence, and despite his best efforts to make them happy, the Odjak of Algiers decided to remove him and kill him in 1808 in favor of Ali ben Mohammed, a leader in the Odjak.