CAMBRIDGE, England — IN the last few years, there has been a dramatic rise of a seemingly new type of polity: the Islamic rebel state. Boko Haram in West Africa, the Shabab in East Africa, the Islamic Emirate in the Caucasus and, of course, the Islamic State in the Middle East, known as ISIS, or ISIL — these movements not only call for holy war against the West, but also use their resources to build theocracies.

Though in some respects unprecedented, these groups also have much in common with the Islamic revivalist movements of the 18th century, such as the Wahhabis on the Arabian Peninsula and the great jihadist states of the 19th century. They waged jihad against non-Muslim powers, and at the same time sought to radically transform their own societies.

One of the first groups to engage in anticolonial jihad and state-building was the fighters led by Abd al-Qadir, who challenged the French imperial invasion of North Africa in the 1830s and 1840s. Qadir declared himself “commander of the faithful” — the title of a caliph — and founded an Islamic state in western Algeria, with a capital in Mascara, a regular army and an administration that enforced Shariah law and provided some public services. The state was never stable, nor did it ever encompass a clearly defined territory; it was eventually destroyed by the French.

Equally short lived was the Mahdist state in Sudan, lasting from the early 1880s to the late 1890s. Led by the self-proclaimed Mahdi (“redeemer”) Muhammad Ahmad, the movement called for jihad against their Egyptian-Ottoman rulers and their British overlords, and it established state structures, including a telegraph network, weapon factories and a propaganda apparatus. The rebels banned smoking, alcohol and dancing and persecuted religious minorities.