1016 Ismaili massacre in Ifriqiya

The 1016 Ismaili massacre in Ifriqiya was a massacre of the Isma'ili Shia Muslim inhabitants of Ifriqiya (modern-day Tunisia, eastern Algeria and western Libya) by Sunni Muslims under the leadership of Maliki jurists and scholars. Sunni riots started in October 1016 in Qayrawan and later spread to other towns, killing about 20,000 Shi'ites.

Background
The Isma'ilis were a sub-sect which split off from the main body of the Shi'ites over succession to the leadership of this sect. This occurred when the sixth Shia imam Ja'far al-Sadiq died in 765. He appointed his son Isma'il ibn Ja'far as successor, although his son died before him. The majority of Shi'ites consequently recognized Isma'il's son as the seventh imam, Muhammad ibn Isma'il. However, the Isma'ilis split off and insisted that Isma'il had not died but would reappear as the Mahdi.

The Isma'ili movement reached the Maghreb in the 9th century, when Abu Abdallah al-Shi'i arrived in Kabylia and won over the Kutama Kabyle inhabitants. He was successful in converting large numbers of the population to Isma'ilism. This movement eventually overthrew the ruling Aghlabid dynasty of Ifriqiya and proclaimed the Fatimid Caliphate in 909. After the Fatimid conquest of Egypt in 969, the Zirids were appointed as local rulers of Ifriqiya as vassals of the Fatimids.

Isma'ilism had never deeply penetrated into the masses of Ifriqiya, and was only present in urban groups, the Kutama and Sanhaja Berbers.

Massacre
During the reign of Zirid ruler Badis ibn al-Mansur, Maliki started becoming more assertive in public life and critical of their Shi'ite rulers. Once Al-Mu'izz ibn Badis became ruler, Sunni riots against Shi'ites began in October 1016. The riots started in Qayrawan and later spread to other towns, such as Mahdiyya, Tunis, Tripoli. The Isma'ili Shia inhabitants were attacked and massacred by Sunnis under the leadership of Maliki jurists and scholars and with the connivance of the government. About 20,000 Shi'ites are said to have been killed. Khaldun al-Balawi and another Qayrawani scholar Abu Muhammad al-Gharyani were killed in March 1017. This massacre weakened the influence of the Shi'ites in economic and political life and demonstrated the strength of Sunni leadership.