Historians agree that the revolutions originated from the constant power conflict between the Muradid dynasty, which attempted to detach itself from Ottoman control and the Turkish militia in Tunis (headed by the divan), which challenged the primacy of the Beys and refused to submit to their increasingly monarchical rule.
[1] Since the Ottoman conquest of 1574, the regency of Tunis had been organised so that the power of the Beys (the Muradids throughout the period in question) was counterbalanced by the divan of the Turkish militia, who elected the Dey, the de facto master of the country, since the pasha was limited to a purely honorific role.
Murad II seized prerogatives of the divan, such as the election of the Dey, acts avoided by his predecessors, who had respected the separation of powers established over the previous century of Ottoman rule in Tunis.
At the death of Murad II in 1675, the divan and the Dey attempted to rid themselves of a master to whom they had to submit and obey; they decided they would no longer allow what they considered to be an usurpation of power by the Muradid Beys.
However, a few weeks after he assumed the position, he exiled his uncle Muhammad al-Hafsi, whom the divan had acquired for their cause and elected as Dey in order to counterbalance his brother Murad II.
Muhammad Ben Cheker, commander of the northwest tribes rallied by the Algerians, had remained in Tunis to monitor the Bey on behalf of the Dey of Algiers.
After a long siege which was excruciating for the populace and the flight of Muhammad Bey al-Muradi to southern Tunisia, Tunis fell into the hands of the Dey of Algiers, Chaabane Khodja, and of Ben Cheker for a second time on 12 November 1694.
Muhammad Bey, with the assistance of Ottoman reinforcements and some other regiments from the tribes, managed to attack Ben Cheker when he was isolated from his Algerian allies.
The battle took place beneath the walls of Kairouan on 1 May 1695;[2] the troops of Ben Cheker were cut to pieces and he fled to the Moroccan sultan Ismail Ibn Sharif.
[2] Muhammad Bey al-Muradi restored peace to the rest of the country and carried out reconstruction work in Tunis, which had been damaged by the two sieges.
[2] Incapable of ruling, Ramadan Bey placed the government of the beylik in the hands of Madhul, his mameluke and musician, originally from Florence.
Revealing his violent and bloody side, he had all the old supporters of his uncle savagely murdered and took the opportunity to eliminate the plotters in the pay of the Dey of Algiers who attempted to use the disorder to seize control of Tunis once more.
Nevertheless, ships full of Anatolian recruits arrived at Ghar El Melh and Murad III Bey led them to the Algerian border in 1702.
Ibrahim Sharif successfully combatted the Bey of Tripoli in the south of the country, but was defeated by the Dey of Algiers near Kef on 10 July 1705.