The Mamluks were mostly Christian slaves converted to Islam, trained in a special school and then assigned to military and administrative duties. They presided, with short intermissions, over several decades in the history of Ottoman Iraq, from 1747 to 1831. The Mamluk ruling elite, composed principally of officers from Georgia, succeeded in asserting autonomy from their Ottoman overlords, and restored order and some degree of economic prosperity in the region. The Ottomans overthrew the Mamluk regime in 1831 and gradually imposed their direct rule over Iraq which would last until World War I