The Mahdist state was not simply an army in the field. From its earliest years it governed the territory it held under sharia courts whose judges enforced Muhammad Ahmad's own rulings, collected in written proclamations, alongside conventional Islamic law, and disputes over inheritance, marriage and property in Mahdist Sudan were settled by that combined authority rather than by Ottoman Egyptian precedent. Military organization mirrored this religious foundation: the Ansar fighting forces, the jihadiya, were organized around personal loyalty to the Mahdi and, after his death, to the Khalifa Abdallahi, with units grouped by the colored flags under which they had originally rallied to the call to jihad.
Abdallahi proved as much an administrator as a military commander. He regularized the state treasury, reintroduced Ottoman Egyptian era taxation methods the Mahdist movement had originally risen against, and relied on captured Egyptian officials to staff the technical posts his own government lacked the trained personnel to fill. That combination, a state whose legal and religious legitimacy rested entirely on the Mahdi's prophetic claim, run in practice through administrative machinery borrowed from the very government it had overthrown, was never fully resolved before Kitchener's reconquest in 1898 ended the state altogether.