Abu Hafs Umar bin Yahya

Abu Hafs Umar bin Yahya (أبو حفص عمر) (also known as Al-Mustansir II) was the Hafsid caliph of Ifriqiya (1284–1295).

After restoring Hafsid rule interrupted by the usurper Ibn Abi Umara (1283–1284), Abu Hafs Umar sought to rebuild the state in the face of invasions and challenges to his authority. He was however unable to prevent the division of Hafsid territories. During the period when the Hafsids had been driven out of Tunis by Ibn Abi Umara, Zakariyya, a nephew of Abu Hafs Umar I, conquered Bejaïa with the support of local tribes and later also gained control of Constantine. In 1285 Zakariyya also attacked Tunis and Tripoli. Although this attack was neutralized by an alliance between Abu Hafs Umar I and the Zayyanids of Tlemcen, Constantine and Bejaïa became independent of the rule of from Tunis. Abu Hafs Umar I died in 1295.

Early life (to 1284)
Abu Hafs Umar was the son of Abu Zakariya Yahya and a slave named Zabya, and younger half-brother of Abu Ishaq Ibrahim I. He was described by the chroniclers as being generous, prudent and pious. Surviving the battle of Marmājanna in June 1283 where most of his male relatives were killed by the usurper Ibn Abi Umara, Abu Hafs Umar took refuge in the fortress of Kalaat es Senam nearby. Tribal leaders of the Banu Sulaym Bedouin came to pledge loyalty to him, and he advanced on Tunis. Ibn Abu Umara's forces deserted and he went into hiding in the city. On 12 July 1284 Abu Hafs Umar proclaimed himself Caliph in the city with the same name his brother had taken, al-Mustansir billah. Within a few days Ibn Abi Umara had been found, forced to confess his imposture, and executed.

Period of rule (1284-1295)
The new caliph did not pursue reprisals against those who had backed Ibn Abi Umar, but left them in peace, or in some cases appointed them to important positions in his own government. Breaking with tradition he rewarded his Bedouin supporters with grants of land, increasing their economic and political power; previous rulers had given them only money. Abu Hafs Umar undertook a major reconstruction of the Great Mosque of Kairouan.

He tried above all to stimulate the economy by promoting trade but he was not able to do so without interruption. In 1288 the Almohad Prince Abu Dabbus landed in Tripolitania with the support of Aragon and claimed rule in Ifriqiya. Although he achieved some successes, he was ultimately unsuccessful, although Aragon used the conflict to occupy Djerba and the Kerkennah Islands.

In 1293, during his reign, the Christian scholar Ramon Llull visited Tunis, intending to start a discussion with the most educated Muslim thinkers and attempt to convert them to Christianity. Llul offered to listen to Muslim arguments and to adopt their religion if he found them more valid than those of Christianity. However his own arguments alarmed his interlocutors who persuaded Abu Hafs Umar to imprison him. He was condemned to death, but the sentence was commuted to banishment after an appeal from one of the Muslim scholars.

Abu Hafs Umar was unable to prevent the division of the empire into two dynasties. During the usurpation of Ibn Abi Umara, Abu Zakariyya, son of his predecessor Abu Ishaq Ibrahim I, had taken Bejaia with tribal support and had later also gained control over Constantine. In 1285 there was a break with Abu Hafs Umar I when Zakariyya attacked Tunis and Tripoli. Although this attack was neutralized by an alliance with the Abdalwadids of Tlemcen, Bejaia became independent from the rulers in Tunis.

Abu Hafs Umar I died in 1295. He was succeeded in Tunis by Abu Asida Muhammad II (1295-1309), a son of Yahya II Al-Wathiq.