|Abu'l-Abbas Muhammad ibn al-Aghlab|
|Predecessor||Abu Iqal al-Aghlab ibn Ibrahim|
|Successor||Abu Ibrahim Ahmad ibn Muhammad|
Muhammad I was the son of the dynasty's fourth emir, Abu Iqal (838-841). Muhammad I turned out to be a great commander and economic strategist, like his uncle Ziyadat Allah I of Ifriqiya and his rival Asad ibn al-Furat. Under his reign, the Aghlabids continued their expansion into the Mediterranean, conquering Messina, Taranto, large parts of Apulia and supporting Emir Kalfün with the establishment of an Islamic Bari.
Naples allied with his preceding rulers and asked for their support to repel the siege of Lombard troops coming from the Duchy of Benevento, but, despite the previous Muslim-Christian alliance, Abul Abbas seized Naples, but only for Khums purposes (Islamic booty), without conquering the territories of Campania.
Notable was his raid on Rome, history's first Muslim invasion of the Caput Mundi and the central administration of the Catholic Church. In 846, Abul Abbas landed at Porto and Ostia with his enormous army. Having surpassed the Tiber, he continued to strike in the Ostiense and Portuense, while the Roman militia swiftly retreated to the safety of the Roman walls. Simultaneously, his other forces landed at the Tyrrhenian Sea port of Civitavecchia. The Vatican Hill was plundered, but Abul Abbas was unsuccessful in storming the protective Aurelian walls of Rome. However, his forces managed to loot huge amount of wealth St. Peter's Basilica, the world's biggest church, and Basilica of Saint Paul Outside the Walls.
In Ifriqiya and Malta, during his rule, agriculture and trade flourished and new urban construction was observed, most notably the Great Mosques of Sousse and Sfax. Muhammad's reign was briefly interrupted by his brother Abu Ja'far Ahmad, who, like his Abbasid contemporary Al-Wathiq, supported the Mu'tazili and persecuted their Sunni opponents, executing some and imprisoning others, most notably the Maliki scholar and jurist Sahnun. When Muhammad Abu'l-Abbas regained the throne in 847, he sent his brother into exile and rehabilitated the Sunnis, making Maliki Sahnun chief qadi of Ifriqiya. He had the reputation of being sympathetic to the Sunnis. For these, it was claimed that he left Shiism and adopted the Sunni doctrine.
Muhammad I died in Palermo in 856. He was succeeded by his son Ahmad ibn Muhammad (856-863), under whose reign the kingdom of the Aghlabids reached its zenith.