After al-Ma'mun's death in 833, his brother and successor,
al-Mu'tasim () is said by one source to have also lived in the Hasani Palace, before he built for himself a new palace in the nearby
Mukharrim quarter. In 836, however, he founded a new city,
Samarra, in the north and moved the caliphal court and capital of the Abbasid empire there. Although Caliph
al-Mu'tamid () spent the last months of his life in Baghdad, it was not until 892 that the Caliph
al-Mu'tadid () returned the capital permanently to Baghdad.
Yaqut al-Hamawi reports that when al-Mu'tamid came to the city, he asked from Buran to take possession of the Hasani Palace as his residence. She asked for a brief delay in order to set her affairs in order, but instead took this time to furnish the palace and make it fit for the caliph, before handing it over to him. This anecdote is widely reported, but the original source of the story, the 11th-century chronicler Khatib, reports that the caliph in question was al-Mu'tadid, and himself expresses doubts about its authenticity, since Buran was known to have died years earlier. According to
Guy Le Strange, however, the incident reported may reflect an earlier visit by al-Mu'tamid to the city. Under al-Mu'tadid, the Hasani became the official caliphal residence. The Caliph added new buildings, including a prison, and enlarged its grounds and enclosed them in a wall. In addition, al-Mu'tadid and
al-Muktafi () built the
Firdus Palace upstream, the
Thurayya Palace to the east, and the
Taj Palace downstream of the Hasani, creating thus a sprawling palace complex, the "Abode of the Caliphate" (), comprising several major and minor residences and gardens. This remained the main caliphal residence for the remainder of the Abbasid Caliphate. Upon his accession in 902, al-Muktafi destroyed the palace prisons built by his father, and erected in their place a
Friday mosque, the ("Palace Mosque"), a site now occupied by a later structure, the . Upon the grounds of the palace, the
Mustansiriya Madrasah was erected in the 1230s. ==References==