 The Turkish army was at first quartered in Baghdad , but quickly came into conflict with the remnants of the old Abbasid establishment in the city ( the abnāʾ ) and the city 's populace , who resented their loss of influence to the foreign troops . This was a major factor in al @-@ Mu 'tasim 's decision in 836 to found a new capital at Samarra , some 80 miles ( 130 km ) north of Baghdad , but there were other considerations at play as well . Founding a new capital was a public statement of the establishment of a new regime , while allowing the court to be " at a distance from the populace of Baghdad and protected by a new guard of foreign troops , and amid a new royal culture revolving around sprawling palatial grounds , public spectacle and a seemingly ceaseless quest for leisurely indulgence " ( Tayeb El @-@ Hibri ) , an arrangement compared by Oleg Grabar to the relationship between Paris and Versailles after Louis XIV . In addition , by creating a new city in a previously uninhabited area , al @-@ Mu 'tasim could reward his followers with land and commercial opportunities without cost to himself and free from any constraints , unlike Baghdad with its established interest groups . In fact , the sale of land seems to have produced considerable profit for the treasury — in the words of Hugh Kennedy , " a sort of gigantic property speculation in which both government and its followers could expect to benefit " . 
