 Space and life in the new capital were strictly regimented : residential areas were separated from the markets , and the military was given its own cantonments , separated from the ordinary populace and each the home of a specific ethnic contingent of the army ( e.g. the Turks , Faraghina , Maghariba and Shakiriyya regiments ) . The city was dominated by its mosques ( most famous among which is the Great Mosque of Samarra built by Caliph al @-@ Mutawakkil ) and palaces , built in grand style by both the caliphs and their senior commanders , who were given extensive properties on the site . Unlike Baghdad , however , the new capital was an entirely artificial creation . Poorly sited in terms of water supply and river communications , its existence was determined solely by the presence of the caliphal court , and when the capital returned to Baghdad , sixty years later , Samarra rapidly declined . 
