This is a book about revolutionary movements of a messianic and millenarian character, led by a "mahdi", in Islamic terms, a charismatic messianic leader. It also addresses the question of mediation between God and men and the political repercussions of this question in the history of the pre-Modern Muslim West. Mahdism is considered in relation to sufi ideas, terminology and symbols which shape notions of authority and of legitimate power when claiming direct, intimate contact between the holy and the divine. The relationship between mahdism and the legitimacy of power, the process by which the messianic paradigm becomes inseparable from the claim to the caliphate are amply discussed. The contents of the book range from the times of the Muslim conquest of North Africa and Iberia, to the first part of the XVIIth century with the end of Muslim Iberia and the beginnings of European intervention in Morocco.