In the 9th century, the Abbasids created an army loyal only to their caliphate, composed predominantly of Turkic Cuman, Circassian and Georgian slave origin known as Mamluks. By 1250 the Mamluks came to power in Egypt. The Mamluk army, though often viewed negatively, both helped and hurt the caliphate. Early on, it provided the government with a stable force to address domestic and foreign problems. However, creation of this foreign army and al-Mu'tasim's transfer of the capital from Baghdad to Samarra created a division between the caliphate and the peoples they claimed to rule. In addition, the power of the Mamluks steadily grew until Ar-Radi (934–41) was constrained to hand over most of the royal functions to Muhammad ibn Ra'iq.