Abū Ja'far Abdallah ibn Aḥmad al-Qādir (Arabic: أبو جعفر عبد الله بن أحمد القادر), better known by his regnal name al-Qā'im bi-amri 'llāh (Arabic: القائم بأمر الله, lit. 'he who carries out the command of God') or simply as al-Qā'im; 8 November 1001 – 3 April 1075), was the Abbasid caliph in Baghdad from 1031 to 1075. He was the son of the previous caliph, al-Qadir. Al-Qa'im's reign coincided with the end of the Buyid dynasty's dominance of the caliphate and the rise of the Seljuk dynasty.
Contents
Early life
Al-Qa'im was born on 8 November 1001. He was the son of Abbasid caliph al-Qadir (r. 991–1031) and his concubine named Qatr al-Nada (died 1060), an Armenian or Greek, also known as Alam.
His father, Al-Qadir had publicly proclaimed his just nine-year-old son Muhammad (elder brother of Al-Qa'im) as heir apparent, with the title of al-Ghalib Bi'llah, in 1001. However, Muhammad died before his father and never ascended to the throne.
In 1030, al-Qadir named his son Abu Ja'far, the future Al-Qa'im, as his heir, a decision taken completely independently of the Buyid emirs. Al-Qadir died after an illness on 29 November 1031. Initially he was buried in the caliphal palace, but in the next year he was ceremonially moved to al-Rusafa. Al-Qa'im, meanwhile, received "the usual oath of allegiance" on 12 December 1031.
Reign
During the first half of al-Qa'im's long reign, hardly a day passed in the capital without turmoil. Frequently the city was left without a ruler; the Buwayhid Emir was often forced to flee the capital.
At this point, the caliph had "very limited personal resources at his command", but he had recovered a bit of power from earlier periods and was able to arbitrate between the Buyid emirs Jalal al-Dawla and Abu Kalijar. In 1032, al-Qa'im sent the jurist al-Mawardi to meet with Abu Kalijar in secret; he was to refuse to grant him any title but "Malik al-Dawla".
While the Seljuk dynasty's influence grew, Chaghri Beg married his daughter, Khadija Arslan Khatun, to Al-Qa'im in 1056.
The Seljuk ruler Tughril overran Syria and Armenia. He then cast an eye upon Baghdad. It was at a moment when the city was in the last agony of violence and fanaticism. Toghrül, under cover of intended pilgrimage to Mecca, entered Iraq with a heavy force, and assuring the Caliph of pacific views and subservience to his authority, begged permission to visit the capital. The Turks and Buwayhids were unfavorable, but Tughril was acknowledged as Sultan by the Caliph in the public prayers. A few days after, Tughril himself — having sworn to be true not only to the Caliph, but also to the Buwayhid amir, al-Malik al-Rahim, made his entry into the capital, where he was well received both by chiefs and people.
The Turkic general Arslan al-Basasiri revolted in 1058 and successfully took Baghdad while Tughril was occupied with his brother's revolt in Iran. Al-Qa'im originally stayed in Baghdad during these events but was later exiled to Anah on al-Basasiri's orders. For about a year, al-Basasiri kept al-Qa'im as his hostage in Anah, as a bargaining chip in negotiations with Tughril. Tughril ended up securing al-Qa'im's freedom by going directly to the amir guarding him, bypassing negotiations with al-Basasiri altogether.
After al-Basasiri died and his revolt came to an end, the Seljuks were left as the single dominant power over al-Qa'im's caliphate. They were similar to the Buyids in this regard, although the Sunni Seljuks were more closely aligned with al-Qa'im in religious matters. Sectarian conflict was a prominent issue during this part of al-Qa'im's reign. A notable incident concerned the opening of the Nizamiyya of Baghdad, a madrasa affiliated with the Shafi'i legal school, in 1067; its opening inflamed tensions with the Hanbalis. Al-Qa'im was reluctant to act without first consulting with the Seljuk sultan and was ultimately unable to control the situation.
Family
One of Al-Qa'im's wives was the sister of Abu Nasr bin Buwayh also known as Malik Rahim. She died in 1049–50. Another wife was Chaghri Beg's daughter Khadija Arslan Khatun. She had been betrothed to his only son Dhakhirat al-Mulk Abu'al-Abbas Muhammad. However, Muhammad died, and Khadija Arslan married Al-Qa'im in 1056. After Al-Qa'im's death in 1075, she married Ali ibn Faramurz. One of Al-Qa'im's concubines was Al-Jiha al-
Qa'mya, an Armenian.
His son Muhammad had a son, Al-Muqtadi, who succeeded his grandfather, born to an Armenian concubine named Urjuwan also known as Qurrut al-Ayn.
Al-Qa'im had a daughter named Sayyida. In 1061, Seljuk Sultan Tughril I sent the qadi of Ray to Baghdad, to ask her hand in marriage to him. The marriage contract was concluded in August–September 1062 outside Tabriz, with a marriage proportion of one hundred thousand dinars. She was brought to the Sultan's palace in March–April 1063. After Tughril's death, his successor Sultan Alp Arslan sent her back to Baghdad in 1064. In 1094, Caliph Al-Mustazhir compelled her to remain in her house lest she should intrigue for his overthrow. She died on 20 October 1102.
Death
When al-Qa'im was on his deathbed in 1075, Fakhr ad-Dawla took charge of his personal care - al-Qa'im did not want bloodletting but Fakhr ad-Dawla had it done anyway. Before he died, al-Qa'im advised his grandson and successor al-Muqtadi to keep the Banu Jahir in their position: "I have not seen better persons for the dawla than Ibn Jahir and his son; do not turn away from them."
Al-Qa'im died on 3 April 1074 at the age of 73. He was succeeded by his grandson Al-Muqtadi as the twenty-seventh Abbasid Caliph.





