In 1015 (AH 406), Mujāhid launched an expedition to conquer the island of
Sardinia in the name of the caliph al-Muʿayṭī. He landed with 120 ships and occupied the southern coastal plain, but was defeated by
Pisan and Genoese forces. The following year he returned with a large force of cavalry, defeated the army of the
judge of Cagliari and fortified the conquered area. He even sent a force to attack
Luni on the Italian coast. The chronicler
Thietmar of Merseburg wrote that he sent a sack of chestnuts to the pope to illustrate the number of Muslim soldiers he would unleash on Christendom, but that
Benedict VIII sent back a sack of millet representing the number of Christian soldiers that would meet them. In May 1016, the people returned to Sardinia. Mujāhid, facing mutiny among his men, fled by sea. His fleet was devastated in a storm and the remaining ships were picked off by the Pisan and Genoese fleets. His mother and his son and eventual successor
ʿAlī were captured, but Mujāhid made it back to Dénia. ʿAlī remained a prisoner for many years. During Mujāhid's absence in Sardinia and probably informed of his difficulties, al-Muʿayṭī tried to seize actual authority in Dénia for himself. Following his return, Mujāhid sent the caliph into exile in Africa. ==Rule in Dénia==