The intellectual battle against ISIS will be less visible and less heroic than the military one. But ultimately, if we are to beat Islamist extremism, it is just as important.

Although the military fight with ISIS will be tough, with the right strategy we can retake the territory that it holds. But armies won't wholly defeat them. The San Bernardino and Fort Hood shooters, the Time Square and Detroit bombers, the murderers who terrorised France with Charlie Hebdo and the Bataclan Theatre attacks were not seeking to build territory.

ISIS is an organisation built around an idea. It is the latest, most competent and brutal iteration of a way of thinking that's around a century old. It was not the so-called Islamic State that attacked New York in 2001, Madrid in 2003 or London in 2005. But those responsible were part of the same movement.

That movement is Islamist extremism. At its core is a belief that all social, political and economic activity must be governed by a single interpretation of Islamic law, and violent jihad is a just way to achieve this.

But when we talk about Islamism, we need to make an important distinction.

Islam is a religion, with the vast array of interpretation and practice that implies.

Islamism is a political ideology, and its violent extremism will not just be beaten on the battlefield.

We have been here before, but with politics, not religion. The Cold War was not won only by military or economic might. The Soviet Union was beaten by a better idea. The principle of freedom — both economic and personal — drew those flooding through the Berlin wall and drew back the Iron Curtain.

As in the Cold War, to defeat ISIS, al-Qaeda and their fellow travellers, we must recognise that the battle will be not only intellectual, but also military. Unlike the Cold War, it is also a theological challenge. Unless we counter the religious justifications used by ISIS, we will not defeat the ideology that drives it, and another group will rise in its place.

To counter the use of religion by ISIS, we must work with the Muslim mainstream. ISIS members present themselves as orthodox Muslims, and this must be ruthlessly challenged. Orthodoxy is defined by the majority of the faith; Islamist extremists may be numerous, but they are not a majority, or anything close.

Islamism is a political ideology, and its violent extremism will not just be beaten on the battlefield.

Our recent study of ISIS and al-Qaeda propaganda, Inside the Jihadi Mind, shows that the ideology that drives the group cynically uses mainstream Islamic doctrine, twisted into a single-minded focus on violent action. The concept of tawhid (the one-ness of God) appears in 74 per cent of the propaganda, but is interpreted so broadly that it includes the duty of establishing a state by force to reflect God's rule. Faith and good works are emphasised, but according to ISIS, these are expressed through violent jihad. This is not Islamic orthodoxy.

The rhetoric that characterises some of the current political debate is exactly the wrong approach and plays into ISIS' hands. They seek to alienate the majority of Muslims from other sections of society, whether in the U.S. or elsewhere. We must resist this.

According to ISIS, a Western Muslim who is not willing to join them or attack their home country is no Muslim at all. The group says that Muslim refugees are apostates for fleeing the "ideal state" of their caliphate. Therefore, calls for blanket surveillance of Muslims or a total rejection of refugees are dangerously misguided.

So how should we respond? ISIS uses current events in its narrative and uses Western policies in its propaganda. But we shouldn't kid ourselves that disengagement will save us. ISIS' rhetoric is clear. If we attack, they label us as "crusaders"; if we retreat, then they cast us as weak, and ripe for assault.

We are not targets for what we do. We are targets for what we stand for: liberty, the rule of law, equality and pluralism.

ISIS doesn't think in decades. When they talk of the West as "crusaders," they are talking literally of those medieval knights; they hold our military actions to be the successors of these religiously sanctioned wars against Islam.

Whatever Western policy is developed towards the Middle East, the ideology of violent Islamism will find justification for its actions. This isn't an argument against well-thought-out foreign policy, but for too long we have avoided the power of ideology.

Our opportunity is that the jihadi ideology remains largely static. It can be challenged, but it will require funding and public space. Intellectuals, religious leaders, politicians, journalists and ordinary Muslims should be vying to build narratives that appeal more powerfully, more viscerally than ISIS propaganda does. Our defeat of ISIS should so comprehensively dismantle the idea that drives the group that no other can arise in its place.

This is not going to be a short fight. Our military engagement with the group will require commitment and a willingness to suffer tragic setbacks. The intellectual battle will be less visible and less heroic. But ultimately, if we are to defeat Islamist extremism, it is just as important.

This article first appeared in the Washington Examiner