The taifa was created in 1010, after the disintegration of the Caliphate of Córdoba, by the freed slaveMujāhid al-ʿĀmirī, a former high functionary of the caliphate, who probably had a Slavic origin. In 1011 Dénia was the first taifa to strike coins. The kingdom had a relatively powerful navy, which in 1015 was used to take control of the Balearic Islands and thence to invade Sardinia. The taifa settled a military camp in the north of the island for one year, as a base for the next attack against the Maritime Republic of Pisa, but it was reconquered by the fleets of Pisa and Genoa: in the fray Mujahid's heir, Ali Iqbal al-Dawla, was captured, and could be ransomed only in 1032. In that period the taifa's ships launched several other raids against the Ligurian and Tuscan coasts. In the 1020s Mujāhid took advantage of the death of the regents of the taifa of Valencia to capture the southern part of that kingdom, which he held for two years. A few years later he supported the rebellion of Ibn Jattab against Ibn Tahir of Murcia. After the rise of Abd al-Aziz ibn Amir in Valencia, Mujahid constantly struggled against him, conquering Murcia, Lorca, Orihuela and Elche, extending his power up to the Segura River. Through the mediation of Sulaymán ibn Hud of Zaragoza, he signed a treaty of peace with Valencia in 1041. Muyahid, who had been educated as slave in the court of the Andalusian ruler Al-Mansur Ibn Abi Aamir, was a patron of several intellectuals, especially writers and ulemas escaping the chaos ensuing the Córdoban dissolution. He protected Denia's Christian community in exchange for their declaration of loyalty, and worked with the Jewish mercantile community. At the death of Muyahid al-Muwaffaq in 1045, he was succeeded by Ali Iqbal al-Dawla, a son by a Christian mother. He was able to maintain his father's conquests for some thirty years, starting a period of peace and prosperity, underpinned by a large commercial fleet based in Dénia. In 1050 the Balearic governor, Abd Allahibn Aglab, gained autonomy for the islands. Dénia's power remained confined to its peninsular possessions until the conquest by the taifa of Zaragoza in 1076. The Balearic taifa of Mallorca remained independent until 1116.