 In 805, the imperial patrician of Sicily Constantine signed a ten-year truce with Ibrahim ibn al-Aghlab, emir of Ifriqiya, but this was not an impediment to the other pirates from North Africa and Muslim Spain to attack repeatedly Sardinia between 806 and 821.In 1015 and again in 1016 the Emir Mujāhid al-‘Āmirī of Denya (Latinized as "Museto") from the "taifa" of Denia, in the east of Muslim Spain (al-Andalus), attacked Sardinia and attempted to establish political control over it.The twelfth-century Pisan "Liber maiolichinus", a history of the 1113–1115 Balearic Islands expedition, records that Mujāhid had managed to take military control of the Sardinian coastal plain; the local Sardinian ruler and judge of Cagliari, Salusius, was in fact killed in the fighting and the Sardinian organised resistance broke down.