Overview
The story of an entrenched military caste like the mamluks in Islamic societies begins with the Abbasid caliphs of the 9th century Baghdad. The earliest mamluks were known as ghilman (another term for slaves, broadly synonymous) and were bought by the early Abbasid caliphs. By the middle of the 9th century, these slaves had become the dominant element in the military. Conflict between these ghilman and the population of Baghdad prompted the caliph al-Mu'tasim to move his capital to the city of Samarra, but this did not succeed in calming tensions; the caliph al-Mutawakkil was assassinated by some of these slave-soldiers in 861 (see Anarchy at Samarra). The Abbasids bought slave-soldiers mainly from areas near the Caucasus (mainly Circassians and Georgians), and from areas north of the Black Sea (Kipchaks and other Turks). Those captured had non-Muslim backgrounds.
The use of mamluk soldiers gave rulers troops who had no link to any established power structure. Local non-mamluk warriors were often more loyal to their tribal sheikhs, their families, or nobles than to the sultan or caliph. If a commander conspired against the ruler, it was often not possible to deal with the conspiracy without causing unrest among the nobility. The mamluk slave-troops were strangers of the lowest possible status who could not conspire against the ruler and who could easily be punished if they caused trouble, making them a great military asset.
After the fragmentation of the Abbasid Empire, military slaves, known as either mamluks or Ghilman, became the basis of military power throughout the Islamic world. The Fatimids of Egypt bought Armenian, Turkic and Sudanese slaves, who formed the bulk of their military and often their administration. The powerful vizier Badr al-Jamali, for example, was a mamluk of Armenian origin. In Iran and Iraq, the Buyids used Turkic slaves throughout their empire, such as the rebel al-Basasiri who eventually ushered in Saljuq rule in Baghdad after attempting a failed rebellion. When the later Abbasids regained military control over Iraq, they also relied on the military slaves called Ghilman.
Under Saladin and the Ayyubids of Egypt, the power of the mamluks increased until they claimed the sultanate in 1250, ruling as the Mamluk Sultanate. Military slavery continued to be employed throughout the Islamic world until the 19th century. The Ottoman Empire's devşirme, or "gathering" of young slaves for the Janissary corps, lasted until the 17th century, while mamluk-based regimes thrived in such Ottoman provinces as Iraq and Egypt into the 19th century.
Read more about this topic: Mamluk