Historians agree that an entrenched military class such as the Mamluks appeared to develop in Islamic societies beginning with the 9th-century Abbasid Caliphate of Baghdad.