The Ansar (Arabic: أنصار), or followers of the Mahdi, is a Sufi religious movement in the Sudan whose followers are disciples of Muhammad Ahmad (12 August 1844 – 22 June 1885), the self-proclaimed Mahdi.
Northern Sudan has long been inhabited by Arab people who farm the Nile valley and follow a nomadic pastoral way of life elsewhere. Sudan came under Egyptian suzerainty when an Ottoman force conquered and occupied the region in 1820–21. Muhammed Ahmad, a Sudanese religious leader based on Aba Island, proclaimed himself Mahdi on 29 June 1881. His followers won a series of victories against the Egyptians culminating in the capture of Khartoum in January 1885.
Muhammed Ahmad died a few months later. His successor, Abdallahi ibn Muhammad, maintained the independence of the Mahdist state until 1898, when an Anglo-Egyptian force regained control. The Mahdi's eldest surviving son, Abd al-Rahman al-Mahdi, was the religious and political leader of the Ansar throughout most of the colonial era of the Anglo-Egyptian Sudan (1898-1955) and for a few years after the Sudan gained independence in January 1956. His descendants have led the movement since then.
Muhammed Ahmad claimed to receive direct inspiration from God. After taking power in Sudan between 1883 and 1885 he established the Mahdist regime, which was ruled by a modified version of the sharia. To distinguish his followers from adherents of other Sufi orders, Muhammed Ahmad forbade the use of the word darwish (dervish) to describe his followers, replacing it with the title Ansar, the term Muhammad used for the people of Medina who welcomed him and his followers after their flight from Mecca.