The Sudanese Mahdī headed a millenarian, revivalist, reformist movement in Islam, strongly inspired by Salafī and Ṣūfī ideas, in late 19th century in an attempt to restore the Caliphate of the Prophet and “Righteous Caliphs” in Medina. As the “Successor of the Prophet”, the Mahdī was conceived of as the political head of the Islamic state and its supreme religious authority. On the basis of his legal opinions, decisions, proclamations and “traditions” attributed to him, an attempt is made to reconstruct his legal methodology consisting of the Qurʾān, sunna, and inspiration (ilhām) derived from the Prophet and God, its origins, and its impact on Islamic legal doctrine, and to assess his “legislation” as an instrument to promote his political, social and moralistic agenda.