Banu Ghaniya

The Banu Ghaniya were a Massufa Sanhaja Berber dynasty and a branch of the Almoravids. Their first leader, Muhammad ibn Ali ibn Yusuf, a son of Ali ibn Yusuf al-Massufi and the Almoravid Princess Ghaniya, was appointed as governor of the Balearic Islands in 1126. Following the collapse of the Almoravid power at the hand of the Almohads in the 1140s, the Banu Ghaniya continued to govern the Balearic Islands as independent emirs until about 1203, with a brief interruption in the 1180s. Later leaders (Ali ibn Ishaq and Yahya) made a determined attempt to reconquer the Maghreb (and in particular Ifriqiya), taking Bougie, Constantine and Algiers, and conquering most of modern Tunisia from about 1180 onwards.

They were influential in the downfall of the Almohad Empire in Eastern Maghrib. In Tunisia, Ali ibn Ishaq adhered to the Abbasid Caliphate and was formally appointed by Al-Mustadi with the title of "heir of the Almoravids".

Origins
The Banu Ghaniya clan were relatives of the ruling Almoravid dynasty. Yusuf ibn Tashfin, the Almoravid emir (d. 1161), gave one of his daughters in marriage to Ali ibn Yusuf, the head of Ghaniya clan. He had two sons with her: Yahya and Muhammad. These two became important governors and commanders during the 1120s, under the reign of Ali ibn Yusuf, the son of Yusuf ibn Tashfin who succeeded him as emir ((r. 1106 – 1143)). Muhammad was appointed governor of the Balearic Islands in 1126. His brother Yahya was governor of Murcia up to 1133 and then transferred to Valencia in 1134.

For much of the 1130s, Tashfin ibn Ali and Yahya led the Almoravid forces to a number of victories over Christian forces and reconquered some towns, holding back the decline of Almoravid power in Al-Andalus (the Iberian Peninsula). The most significant vicrtory was the Battle of Fraga in 1134, where the Almoravids, led by Yahya, defeated an Aragonese army besieging the small Muslim town of Fraga. Notably, Alfonso I El Batallor was wounded and died shortly after.

The Ghaniya brothers were among the last commanders to hold out as Almoravid power collapsed in al-Andalus. In 1144 or 1145, Yahya was transferred from eastern al-Andalus to Seville in order to counter the rebellion of Ibn Qasi in the west. Starting in 1146, the Almohads arrived in al-Andalus, but Yahya continued to organize resistance against them from Córdoba. Eventually, faced with attacks by the Christian kingdoms to the north and the Almohad invasion, Yahya attempted to reach an agreement with his enemies to remain as lord of Jaén, but he was soon expelled from there too by Alfonso VII of León and Castile. He retreated to Granada, the last outpost of Almoravid rule, where he persuaded the governor to surrender to the Almohads. He died here in late 1148 or early 1149.

Meanwhile, his brother Muhammad remained lord of the Balearics and many remaining members of the Almoravid faction joined him there. He became an independent ruler and founded a new dynasty.

Rule in the Balearics
Following the fall of the last Almoravid ruler in Marrakesh in 1147, the Banu Ghainya maintained control of the Balearics and held off several Almohad attacks on the islands. Muhammad remained in power until 1156, when a palace coup replaced him with his son, Ishaq. Under his reign, the kingdom derived revenues through piracy generally aimed at Christian ships. The Almohad caliph, Abu Yaqub Yusuf ((r. 1163 – 1184)), sent him an emissary demanding his submission, but Ishaq continued to formally recognize the Abbasid caliphs and attempted to assuage the Almohad caliph with lavish gifts instead. Ishaq died during a pirate expedition in 1183.

Ishaq was initially succeeded by his oldest son, Muhammad. Faced with hostility from both the Christians and Almohads, he sent a message to Marrakesh expressing his agreement to submit to the Almohad caliphs. An Almohad fleet under Ibn Reberter (a Christian mercenary) was sent to take control of the islands. Before it arrived, Muhammad was deposed by the other Almoravid chiefs, who placed his brother 'Ali in power instead. Ali was opposed to Almohad rule and was further pressured to resist them by the Almoravid refugees who lived on the islands. Thus, when the Almohad fleet arrived, he repelled it and captured its commander. Instead of waiting to face an Almohad counter-attack and possible blockade of the islands, Ali decided to take the offensive and attack the Almohads directly in the eastern Maghreb.

Emirs



 * Muhammad ibn Ali ibn Yusuf 1126–1156 (deposed)
 * Ishaq ibn Muhammad (son) 1156–1183
 * Muhammad ibn Ishaq (son) 1183–1184
 * To Almohad 1184
 * Ali ibn Ishaq (known as Ali ibn Ghaniya) 1184–1188, emir (by conquest) of Bougie (1185–1186) Algiers (1186) and Gafsa (1186–1187), warlord in Tunis 1187–1188
 * Tashfin ibn Ishaq, emir of Majorca (in opposition to 'Ali) 1185–1187
 * 'Abdallah ibn Ishaq (known as 'Abdallah ibn Ghaniya), emir of Majorca 1187–1203
 * Yahya ibn Ishaq (known as Yahya ibn Ghaniya) 1188–1202/1203 warlord in Tunis 1188–1212