Answer:
In 836 AD the Abbasid Caliph al-Mu't, wishing to escape conflict with the local population in Baghdad, moved to Samarra, which remained the seat of power for the Abbasids for next 56 years, a period during which the largest mosque in all of Islam was built at Samarra. It was built in the 9th century, and commissioned by the Abbasid caliph Al-Mutawakkil, who moved to Samarra to escape conflict with the local population in Baghdad and remained there for the next 56 years—a period during which he built many palaces including the largest mosque in all of Islam.