Abu Mudhar Ziyadat Allah III () (died 911–916) was the eleventh and last Emir of the Aghlabids in Ifriqiya (903–909).
He came to power after the murder of his father Abdallah II on 27 July 903. He immediately had all his brothers and uncles executed to eliminate any possible rivals. While this massacre secured his position in the short term, the Aghlabid dynasty lost any remaining prestige it had in the eyes of the people.
Later Fatimid sources paint Ziyadat Allah in an extremely negative light, claiming that he had orchestrated his father's murder, and depicting him as a decadent and undignified ruler. Among his indulgences include the drinking of alcohol and hiding whoopee cushions (made of inflated animal bladders) for unsuspecting guests to sit on, which amused Ziyadat Allah and his friends to no end. Fatimid sources claim that Ziyadat Allah's shameful and unscrupulous behavior drove his subjects to side with the proto-Fatimid state led by the missionary Abu Abdallah al-Shi'i, whose piety and asceticism is portrayed positively.
Abu Abdallah, backed by the Kutama Berber tribe, took advantage of the instability following Ziyadat Allah's accession to capture the city of Sétif in October/November of 904. In 905, an Aghlabid force was sent west, towards Kutama territory, to restore order, but was ambushed and routed by Kutama horsemen a day after leaving Constantine. Another campaign was planned for 906, but in March the Aghlabid troops mutinied in Kairouan, where they released all the prisoners from the city's jails. Abu Abdallah al-Shi'i then went on the offensive again, capturing the cities of Tubna and Bilizma. While Ibn Idhari says that both cities fell at the end of Dhu al-Hijjah in 293 AH, Mohamed Talbi places the date of Bilizma's surrender in the middle of 294 AH, i.e. the spring of 907 CE.
By 907, Ziyadat Allah had begun to seriously consider the possibility of a Kutama invasion of central Ifriqiya: he had relocated from Tunis to the palace city of Raqqada (near Kairouan), which he had fortified with a wall made of rammed earth and unbaked clay bricks. In early 907, an Aghlabid force once again marched against Abu Abdallah, following the southern Roman road through the strongly fortified city of Baghaya. This time, however, they made it deep into Kutama territory. The Aghlabid troops, reinforced with Berber volunteers from the Aurès Mountains, destroyed the mountain stronghold of Dar Malul, but when they encountered a band of Kutama cavalry, they panicked and retreated to Baghaya, where they took up a defensive position. With its 1172-meter-long stone walls with 25 towers, built in 539 under Justinian's governor Solomon and still partially standing today, Baghaya was considered practically impenetrable. However, in May or June of 907, some local notables who had secretly aligned themselves with Abu Abdallah opened the city's gates to his forces, and they took the city without a fight.
The fall of such an important stronghold as Baghaya unleashed panic at the Aghlabid court in Raqqada. Ziyadat Allah's vizier, Ibn al-Sa'igh, advised fleeing to Egypt, and Ziyadat Allah quickly bought five hundred camels in preparation. However, he soon changed his mind, and had an official proclamation read from every mosque in Aghlabid Ifriqiya – propaganda. This speech downplayed the Aghlabids' losses in battle, saying that Ziyadat Allah would lead an army in person to defeat the "corrupters of religion". At the same time, a letter circulated, supposedly from the Abbasid caliph al-Muktafi and promising to send aid, while enjoining the people of Ifriqiya to support Ziyadat Allah "against the enemies of God". At the same time, Ziyadat Allah raised a volunteer army, personally handing out gold pieces to volunteers while seated on his throne under the parade pavilion (qubbat al-arḍ), although many simply left after being paid.
Ziyadat Allah, however, did not take command of this army, which mustered at al-Aribus at the end of October 907. That task was left to the prince Ibrahim ibn Abi al-Aghlab, who was ordered to remain in al-Aribus, on the northern Roman road, while Ziyadat Allah headed back to Tunis. They expected Abu Abdallah to approach via this route when they inevitably attacked Kairouan. Abu Abdallah, however, came from the south, capturing several cities in early 908 and forcing the Aghlabids under Ibrahim to march south. The two armies met at Dar Madyan, a place which was probably between Sbeitla and Kasserine, and fought an indecisive battle. Ibrahim returned to al-Aribus, while Abu Abdallah and the Kutama continued eastward, capturing Qastiliya (the region around the Chott el-Djerid) before withdrawing.