Sultan Moulay Isma'il Ibn Sharif
Morocco was in a state of turmoil when Sultan Isma'il inherited the kingom. Power struggles within the Moroccan Amazigh 'Berber' tribes and the royal family threatened to pull Morocco apart at the seams. After Isma'il's corronation the city of Marrakesh refused to acknowledge his authority, and instead chose to follow his nephew, Ahmad ibn Muhriz. Isma'il defeated Ahmad and reclaimed the city, but Ahmed escaped capture and returned to lead Marrakesh against Isma'il again in 1674. According to Chouki El Hamel, these events convinced Isma'il that he needed a completely loyal fighting force he could use to suppress his enemies and run his kingdom.
Sultan Isma'il found a solution by examining the reign of the Saadi Sultan, al-Mansur as-Sa'di, who ruled Morocco from 1578 until his death in 1603. Sultan al-Mansur used enslaved black Africans to reinforce his army, and many of the descendents of those slaves still lived in Morocco. Isma'il commanded his officials to conscript every black person they could find into his new army regardless of if they were free or still enslaved. One court record titled "Daftar Mamalik as-Sultan Mawlay Isma'il", or "The Register of the Slaves of Sultan Moulay Isma'il", stated he conscripted over 3,000 black men, women, and children from Marrakesh into his slave army in the first year. Isma'il fed, clothed, and housed his new slaves at the Moroccan tax payer's expense, and they even gained a degree of authority from their close relationship with the sultan. Sultan Isma'il may not have brought slavery to Morocco, but he certainly expanded it to serve his needs.
However, the enslaved people of Morocco paid for that tangential authority with their freedom. They lived their lives at the mercy of the Sultan, and he could have them killed or tortured at the slightest whim. In fact, by all accounts he often did. One form of punishment was to have a group of slaves grab the offending party by the hands and feet, and throw them from the high walls of his palace until their neck broke. If one of the enslaved women in Isma'il's harem was suspected of cheating on him he sometimes strangled them to death himself. Even if the sultan did not have them killed enslaved people were forced to live where he said, fight when commanded, and marry whoever he desired them to.