war (fitna) had broken out between various factions (taifas) after 1009 in the declining caliphate. A freed slave, Mujāhid found it necessary to legitimise his position by appointing a puppet caliph, ʿAbd Allāh ibn ʿUbayd Allāh ibn Walīd al-Muʿiṭī, in 1013. He probably saw an opportunity to secure his authority by waging a holy war (jihād), a device which had been used effectively by the man who appointed Mujāhid to rule Denia, al-Manṣūr. The conquest of Sardinia was thus undertaken in the name of al-Muʿiṭī, and the Islamic historian Ibn al-Khatīb praised Mujāhid before God for his piety in the event. One school of Islamic jurisprudence, represented in Mujāhid's day by al-Mawardī, recognised "emirs by conquest", those like Mujāhid who had a right to rule lands they conquered for Islam. In 1015 Mujāhid came to Sardinia with 120 ships, a large number which confirms that the expedition was not designed for raiding. The twelfth-century Pisan Liber maiolichinus, a history of the 1113–1115 Balearic Islands expedition, records that Mujāhid controlled all of the Sardinian coastal plain. In the Pisan histories of the time the expedition to Sardinia of 1015 is described tersely: "the Pisans and Genoese made war with Mujāhid in Sardinia, and defeated him by the grace of God" and "the Pisans and Genoese defended Sardinia." The annals covering the years 1005–16 are quoted in their entirety below. The dating of the expedition to 1015 is based on the Pisan calendar, which also dates Mujāhid's second expedition to 1017: The account of the Liber maiolichinus is more detailed, although it excludes the Genoese, and so is probably referring to the 1015 expedition. It reports that even the Pisan nobles, in their eagerness, took turns rowing the galleys. It also compares them to starving lions rushing their prey. Mujāhid fled at the approach of the Italians, according to the Liber, which does not mention an actual engagement in 1015. Second Muslim expedition (1016) Mujāhid returned to Sardinia in 1016 intending a more thorough conquest of the island. To this end he brought along a reported thousand horses from the Balearics. On these islands, which were renowned for their horses and mules, Mujāhid had reformed the tax system and put the stables at the service of the government in preparation for his expedition. He arrived off Sardinia with a large fleet and a landing force capable of a rapid conquest. The local