The war ended with the assassination of Murad III and his entire family by Ibrahim el Sharif, who had more specific plans after his return from Istanbul.
[2] The Algerian army entered the Tunisian territory on 8 July and set their camps close to Kef in Oued el-Tin (probably Oued-Mellègue).
The most influential one of them, Al-Husayn I ibn Ali, proclaimed himself Dey and founded the Husainid dynasty on 10 July 1705, putting an end to the Muradid War of Succession.
The Tunisians who were 18,000 individuals,[5] fearing the pillage of their city, resisted and protested against the Dey Moustapha, causing Husayn to pay him a ransom of 150,000 Piastres to lift the siege.
The Dey then noted that food and ammunition were becoming increasingly short and that winter was approaching, leaving Mustapha no choice but to abandon the siege and go back to Algiers.
Finally, after five years of political and economic instability, Baba Ali Chaouch became Dey and restored stability to the republic.