البجا
Muhammad Ahmad's early insurgent force which was mostly recruited among the poor Arab communities living at the Nile. The later armies of the Mahdiyah were recruited among various groups, including mostly autonomous groups such as the Beja people. The early forces of the Mahdi were termed the "ansar", and divided into three units led by a Khalifa. These units were termed "raya" ("flags") in accordance to their standards. The "Black Flag" was mostly recruited from western Sudanese, mainly Baggara, and commanded by Abdallahi ibn Muhammad. The "Red Flag" was led by Muhammad al-Sharif and mostly consisted of riverine recruits from the north. The "Green Flag" under Ali Hilu included troops drawn from the southern tribes living between the White and Blue Nile. After the Mahdi's death, the command of the "Black Flag" was passed to Abdallahi ibn Muhammad's brother Yaqub and became the state's main army, based at the capital Omdurman.