Hammadid capture of Béja (1015)

The Hammadid capture of Béja in 1015 was an important military encounter between the Hammadid dynasty led by Hammad ibn Buluggin and the Zirid dynasty, led by Hashim,the best generale of Badis ibn Al-Mansur. This occurred during the Hammadid-Zirid War, which ultimately resulted in the independence of the Hammadid emirate, thus splitting the previous Zirid domains into two independent emirates.

Background
Upon granting the leadership over three provinces in Hammad's domains to his son Al-Mu'izz, Badis ordered Hashim and Ibrahim to embark on April 11, 1015. Ibrahim carried with him four hundred thousand dinars, along with his people and slaves, without encountering any opposition from Badis. Sensing that Hammad's brother might betray him if approached, Hashim ibn Ja'far apologized, stating that he still had unfinished business in Béja. He altered his course towards it, promising to catch up quickly. Ibrahim reached Tamditt, a two-day journey from Laribus. He then wrote to his brother Hammad to update him on the situation. Hammad mobilized thirty thousand horsemen and set out. Upon meeting, the brothers consulted and agreed to rebel against Badis. Thus, a war ensued between Hammad and Ibrahim on one side and Badis, the Zirid prince, on the other.

Battle
On the second of June 1015 CE, Badis marched with a great army to fight Hammad. He ordered Hashim to fortify himself in the city of Shuqbanaria (present-day El Kef), southwest of Béja. Hashim complied with his order, but Hammad and Ibrahim besieged him in Shuqbanaria. Hashim was forced to march towards Béja. When Hammad heard about the approaching Zirid army, he attempted to deceive Badis by writing a letter to him, in which he confirmed: "That he has not separated from the dynasty nor deviated from obedience," and informed him that he had prepared a gift for Al-Mu'izz ibn Badis, the son of the Zirid emir, particularly including two thousand fine horses and a thousand dinars. Similarly, Ibrahim sent him a message to the same effect. However, at the same time, Hammad and Ibrahim continued the war. Hammad conquered Béja, plundered it, and massacred a large number of its inhabitants, despite having promised them safety. Notably, Hammad obtained both Hashim's wealth and his soldiers.

Aftermath
After the conquest of Béja, Hammad incited the inhabitants of Tunis, who were mostly Sunni, against the Easterners, meaning the supporters of the Fatimids and the Shiites. Their leader, Mahrez ibn Khalf, was highly influential in Ifriqiya. He urged them to kill the Shiites, resulting in the death of a large number of them in the year 1015. These events troubled Badis because he feared that they might spoil the relations between the Zirids and the Fatimids. Thus, he sent Yala ibn Farrah to Tunis to severely punish the criminals. When the people of Tunis heard about the arrival of Yala ibn Farrah, they contemplated fleeing. However, Mahrez ibn Khalf remained in his house and wrote to Badis to reproach him. Badis pardoned the people of Tunis, and it is said that he ordered the removal of the teeth of his minister because he had insulted Mahrez ibn Khalf. Both Hammad and Badis continued marching westwards until they met at the Battle of Chelif, where many of Hammad's followers had already joined Badis's side following his killing of civilians upon the capture of Béja.