The Taj Palace was one of the principal caliphal palaces in Baghdad during the middle and later Abbasid Caliphate. The palace was begun by the sixteenth Abbasid caliph, al-Mu'tadid, as part of the building projects begun when the capital of the Caliphate was moved back to Baghdad from Samarra. It lay on the banks of the Tigris River in southern East Baghdad, just south of the older Hasani Palace. It was thus the southernmost portion of a sprawling palace complex, the "Abode of the Caliphate", that included the Hasani and the Firdus Palace, also built by al-Mu'tadid, as well as gardens and minor palaces. However, in 899 al-Mu'tadid ordered construction stopped, because its location made it likely that the smoke from the hearths of the nearby residential districts would waft over to the palace. In the end, it was his son and successor, al-Muktafi, who completed construction of the Taj. For this purpose he demolished an earlier palace, the "Palace of Perfection", but also plundered the ancient palace of the Sasanian rulers in Ctesiphon for building material: the bricks of its foundations were reused to build an artificialdyke that buttressed the palace foundations against the river, while the stones of the battlements were reused to decorate the Taj Palace's superstructures. Among the numerous buildings that comprised the Taj Palace was a semicircular tower, known as the "Cupola of the Ass". The caliph could ride to its top to mounted on a donkey, and from there gaze on the surrounding countryside. Al-Muktafi's brother and successor, Caliph al-Muqtadir, expanded the palace grounds by adding a vast wild beast park stretching between the Taj and another of al-Mu'tadid's new palaces, the Thurayya Palace on the Musa Canal. In the description of the reception of a Byzantine embassy in 917, which took place in the Taj, it is said to have numbered no less than 23 distinct buildings, including the "Palace of the Tree", named after a large automaton at its centre, in the shape of a tree made of silver, that weighed 500,000 dirhams. The tree had 18 branches with leaves of silver and gold, on which perched mechanical birds of silver and gold; the leaves moved with the wind, while the tree's mechanisms' allowed the birds to sing. The tree was surrounded by a circular reflective pool of water. The pool was flanked on either side by two rows of fifteen life-size statues of horsemen armed with javelins, with those of the right appearing to be attacking those on the left row. In later times the Palace of the Tree was used as a state prison, where members of the dynasty were confined. A beautiful orange-tree garden planted by al-Muqtadir's successor, al-Qahir, was also likely located in the grounds of the Taj. Caliph al-Mustarshid added a new reception hall to the palace, known after its gateway as the "Privy Chamber Gate". This became the main audience hall, where the caliph would receive dignitaries and bestow robes of honour on them. In 1154, during the reign of al-Muqtafi, the Taj was struck by lightning. The resulting fire erupted that lasted for nine days and destroyed most of the palace, including the Cupola of the Ass. Al-Muqtafi began to rebuild the Cupola of the Ass to the original plan, but after he died, work was stopped. In 1178, Caliph al-Mustadi ordered both the half-finished Cupola of the Ass, as well as the remains of the other palace buildings, demolished and levelled to the level of the top of the dyke. The flat space that resulted was used as the foundation of a new Taj Palace, which stood somewhat further up the river bank than the original structure. Its main building rose some 105 feet above the water and rested, like its predecessor, on a vaulted first storey: five marble columns supported five great arches, which converged on a central, sixth column, that held up the structure.