Cheer up. We're winning this War on Terror

"My centre is giving way. My right is in retreat. Situation excellent. I shall attack!”

If only our political leaders and opinion-formers displayed even a hint of the defiant resilience that carried Marshal Foch to victory at the Battle of the Marne. But these days timorous defeatism is on the march. In Britain setbacks in the Afghan war are greeted as harbingers of inevitable defeat. In America, large swaths of the political class continues to insist Iraq is a lost cause. The consensus in much of the West is that the War on Terror is unwinnable.

And yet the evidence is now overwhelming that on all fronts, despite inevitable losses from time to time, it is we who are advancing and the enemy who is in retreat. The current mood on both sides of the Atlantic, in fact, represents a kind of curious inversion of the great French soldier's dictum: “Success against the Taleban. Enemy giving way in Iraq. Al-Qaeda on the run. Situation dire. Let's retreat!”

Since it is remarkable how pervasive this pessimism is, it's worth recapping what has been achieved in the past few years.

Afghanistan has been a signal success. There has been much focus on the latest counter-offensive by the Taleban in the southeast of the country and it would be churlish to minimise the ferocity with which the terrorists are fighting, but it would be much more foolish to understate the scale of the continuing Nato achievement. Establishing a stable government for the whole nation is painstaking work, years in the making. It might never be completed. But that was not the principal objective of the war there.

Until the US-led invasion in 2001, Afghanistan was the cockpit of ascendant Islamist terrorism. Consider the bigger picture. Between 1998 and 2005 there were five big terrorist attacks against Western targets - the bombings of the US embassies in Africa in 1998, the attack on the USS Cole in 2000, 9/11, and the Madrid and London bombings in 2004 and 2005. All owed their success either exclusively or largely to Afghanistan's status as a training and planning base for al-Qaeda.

In the past three years there has been no attack on anything like that scale. Al-Qaeda has been driven into a state of permanent flight. Its ability to train jihadists has been severely compromised; its financial networks have been ripped apart. Thousands of its activists and enablers have been killed. It's true that Osama bin Laden's forces have been regrouping in the border areas of Pakistan but their ability to orchestrate mass terrorism there is severely attenuated. And there are encouraging signs that Pakistanis are starting to take to the offensive against them.

Next time you hear someone say that the war in Afghanistan is an exercise in futility ask them this: do they seriously think that if the US and its allies had not ousted the Taleban and sustained an offensive against them for six years that there would have been no more terrorist attacks in the West? What characterised Islamist terrorism before the Afghan war was increasing sophistication, boldness and terrifying efficiency. What has characterised the terrorist attacks in the past few years has been their crudeness, insignificance and a faintly comical ineptitude (remember Glasgow airport?)

The second great advance in the War on Terror has been in Iraq. There's no need to recapitulate the disasters of the US-led war from the fall of Saddam Hussein in April 2003 to his execution at the end of 2006. We may never fully make up for three and a half lost years of hubris and incompetence but in the last 18 months the change has been startling.

The “surge”, despite all the doubts and derision at the time, has been a triumph of US military planning and execution. Political progress was slower in coming but is now evident too. The Iraqi leadership has shown great courage and dispatch in extirpating extremists and a growing willingness even to turn on Shia militias. Basra is more peaceful and safer than it has been since before the British moved in. Despite setbacks such as yesterday's bombings, the streets of Iraq's cities are calmer and safer than they have been in years. Seventy companies have bid for oil contracts from the Iraqi Government. There are signs of a real political reconciliation that may reach fruition in the election later this year.

The third and perhaps most significant advance of all in the War on Terror is the discrediting of the Islamist creed and its appeal.

This was first of all evident in Iraq, where the head-hacking frenzy of Abu Musab al-Zarqawi and his associates so alienated the majority of Muslims that it gave rise to the so-called Sunni Awakening that enabled the surge to be so effective.

But it has spread way beyond Iraq. As Lawrence Wright described in an important piece in The New Yorker last month, there is growing disgust not just among moderate Muslims but even among other jihadists at the extremism of the terrorists.

Deeply encouraging has been the widespread revulsion in Muslim communities in Europe - especially in Britain after the 7/7 attacks of three years ago. Some of the biggest intelligence breakthroughs in the past few years have been achieved from former al-Qaeda supporters who have turned against the movement.

There ought to be no surprise here. It's only their apologists in the Western media who really failed to see the intrinsic evil of Islamists. Those who have had to live with it have never been in much doubt about what it represents. Ask the people of Iran. Or those who fled the horrors of Afghanistan under the Taleban.

This is why we fight. Primarily, of course, to protect ourselves from the immediate threat of terrorist carnage, but also because we know that extending the embrace of a civilisation that liberates everyone makes us all safer.

Every death is an unspeakable tragedy. It's right that each time a soldier is killed in action we ask why. Was it really worth it?

The right response to the loss of brave souls such as Corporal Sarah Bryant, the first British woman to die in Afghanistan, is not an immediate call for retreat. It is, first of all, pride; a great, deep conviction that it is on such sacrifice that our own freedoms have always rested. Then, defiance. How foolish is the enemy that it might think our grief is really some prelude to their victory? Finally, confidence. We are prevailing in this struggle. We know it. And everywhere: in Afghanistan, in Iraq, and among Muslims around the world, the enemy knows it too.

Gerard Baker