Islamic Tripolitania and Cyrenaica

With tenuous Byzantine control over Libya restricted to a few poorly defended coastal strongholds, the Arab invaders who first crossed into Pentapolis, Cyrenaica in September 642 encountered little resistance.

Under the command of Amr ibn al-A'as, the armies of Islam conquered Cyrenaica, renaming the Pentapolis, Barqa.

[2] Then Khalid ibn al-Walid, who previously involved in the conquest of Oxyrhynchus, offered a radical plan to erect catapult which filled by cotton sacks.

A clause was further inserted in the peace treaty that part of the Jizya coming from the district was to be spent on the poor of the area.

The campaign lasted fifteen months, after which Abdallah's force returned to Egypt after Gregory's successor Gennadius promised them an annual tribute of some 330,000 nomismata.

From Sicily the Byzantines dispatched an army to reinforce Africa, but its commander, Nicephorus the Patrician lost a battle with the Arabs and reembarked.

The Aghlabid emirs took their custodianship of Libya seriously, repairing Roman irrigation systems, restoring order and bringing a measure of prosperity to the region.

An Almohad emir, Muhammad bin Abu Hafs, ruled Libya from 1207 to 1221 and established the Hafsid dynasty.

Aghlabids dynasty at the beginning of 9th century.