With its extreme violence and slick propaganda, the Islamic State in Iraq and Syria (ISIS) seems like a death cult bent on senseless destruction.
In its propaganda, ISIS emphasises two major themes: A righteous and idyllic life for "true" Muslims in its self-declared Islamic state in parts of Syria and Iraq, and an ideology that sanctifies violence as the only means for Sunni Muslims to achieve power and glory. The group is highly sophisticated in its use of social media to sow fear among its enemies and to entice alienated Muslims living in the West to "emigrate" to ISIS-controlled territory.
But the mastery of those modern tools is underpinned by selective and often extreme interpretations of Islamic texts - understandings that are rejected by the majority of the world's Muslims. And like other militant Islamist movements, especially Al-Qaeda and its offshoots, ISIS is inspired by a group of clerics and religious scholars across Islam's history who advocated the idea of declaring other Muslims as infidels or apostates, and justifying their killing. This notion of takfir is central to the ideology of most of today's Islamist militant groups, who have killed far more Muslims than non-Muslims.
Since the 1960s and 1970s, militant movements and some Islamic regimes have imposed austere interpretations of the Quran and of Islamic law, the syariah. These run counter to a millennium of moderate understandings, including tolerance for other faiths.
Syariah is not a monolithic system of mediaeval codes, set in stone and based solely on cruelty and punishment. Since Islam was founded in the 7th century, the body of law has co-evolved with different strains of Islamic thought: tolerance versus intolerance, forgiveness versus punishment, innovative versus literalist.
Today's Islamist militants and repressive regimes - especially Saudi Arabia, which has used its oil wealth to export its Wahhabi doctrine throughout the Muslim world - are obsessed with literalist interpretations of syariah and punitive aspects of the Quran, as opposed to strands that emphasise forgiveness. The weight of Islamic history skews towards moderate understandings, but in recent decades these regimes (which also include Iran, Pakistan and Sudan) and militants have used their influence to breed intolerance.
ISIS cherry-picks the sources and scholars it chooses to emulate. In the 13th century, as the Mongols swept across Asia and sacked Baghdad, the Mongol warrior Hulagu, a grandson of Genghis Khan, threatened to overrun the Levant. While many Muslim scholars at the time lined up to support the Mongols, one jurist forcefully rejected the invaders. Ibn Taymiyya, an Islamic scholar from Damascus, issued several fatwas against the Mongols - and Al-Qaeda, ISIS and other militants still quote those rulings today.
After Hulagu, some Mongol leaders nominally converted to Islam, but Ibn Taymiyya considered them infidels. He also argued that it was permissible for believers to kill other Muslims during battle if those Muslims were fighting alongside the Mongols. Ibn Taymiyya is the intellectual forefather to many modern-day Islamist militants who use his anti-Mongol fatwas - along with his rulings against Shi'ites and other Muslim minorities - to justify violence against fellow Muslims, or to declare them infidels using the concept of takfir.
Ibn Taymiyya also inspired the father of the Wahhabi strain of Islam that is dominant in Saudi Arabia today, the 18th century cleric Muhammad ibn Abd al-Wahhab, who decreed that many Muslims had abandoned the practices of their ancestors.
He believed Islamic theology had been corrupted by philosophy and mysticism. He argued that Islamic law should be based on a literal interpretation of only two sources: the Quran and the Sunnah. He dismissed analogical reasoning and the consensus of scholars, two sources that had helped Islamic law evolve over time.
Today, Saudi Arabia is built on an alliance between two powers: the ruling House of Saud, and clerics who espouse Wahhabism and seek to return to what they believe is the "pure" form of Islam, as practised by Prophet Muhammad and his followers in 7th century Arabia.
Of course, radicalism needs more to breed than just rhetorical and religious inspirations. As Arab nationalist leaders and military rulers rose to power in parts of the Middle East in the 1950s and 1960s, they violently suppressed Islamist movements.
In Egypt, the regime of Gamal Abdel Nasser clamped down on the populist Muslim Brotherhood, and that helped lay the ideological foundations for the emergence of violent Islamist movements in the following decades.
The most militant thinker that emerged from that period was Sayyid Qutb, a Brotherhood leader who was swept up in Nasser's crackdown. After nine years of prison and torture, Qutb published a manifesto in 1964, Milestones Along The Road, in which he argued that the secular Arab nationalism of Nasser and others had led to authoritarianism and a new period of jahiliyya, a term that has particular resonance for Islamists because it refers to the pre-Islamic "dark ages".
Qutb declared that a new Muslim vanguard was needed to restore Islam to its role as "the leader of mankind" and that a Muslim ruler who does not apply Islamic law - in its most austere forms - should be removed from power.
Qutb argued that it was not only legitimate, but also a religious duty, for "true" believers to forcibly remove a leader who had allegedly strayed from Islam.
Qutb was executed in 1966, but his ideas lived on and inspired militant leaders, among them Osama bin Laden and his deputy, Ayman al-Zawahiri, the leader of Al-Qaeda after Osama's death.
In this vein, ISIS reads Islam's history and its foundational texts selectively, choosing the parts and thinkers who fit its vision of brutality and constant war with pretty much everyone else.
•The writer is a journalism professor at New York University and a former Middle East bureau chief at Newsday.
A version of this article appeared in the print edition of The Straits Times on November 28, 2015, with the headline 'The roots of ISIS theology'. Print Edition | Subscribe
We have been experiencing some problems with subscriber log-ins and apologise for the inconvenience caused. Until we resolve the issues, subscribers need not log in to access ST Digital articles. But a log-in is still required for our PDFs.