I have rarely seen the Commons so full and so silent as when it met yesterday to hear of the London bombings. A forum that often is raucous and rowdy was solemn and grave. A chamber that normally is a bear pit of partisan emotions was united in shock and sorrow. Even Ian Paisley made a humane plea to the press not to repeat the offence that occurred in Northern Ireland when journalists demanded comment from relatives before they were informed that their loved ones were dead.

The immediate response to such human tragedy must be empathy with the pain of those injured and the grief of those bereaved. We recoil more deeply from loss of life in such an atrocity because we know the unexpected disappearance of partners, children and parents must be even harder to bear than a natural death. It is sudden, and therefore there is no farewell or preparation for the blow. Across London today there are relatives whose pain may be more acute because they never had the chance to offer or hear last words of affection.

It is arbitrary and therefore an event that changes whole lives, which turn on the accident of momentary decisions. How many people this morning ask themselves how different it might have been if their partner had taken the next bus or caught an earlier tube?

But perhaps the loss is hardest to bear because it is so difficult to answer the question why it should have happened. This weekend we will salute the heroism of the generation that defended Britain in the last war. In advance of the commemoration there have been many stories told of the courage of those who risked their lives and sometimes lost their lives to defeat fascism. They provide moving, humbling examples of what the human spirit is capable, but at least the relatives of the men and women who died then knew what they were fighting for. What purpose is there to yesterday's senseless murders? Who could possibly imagine that they have a cause that might profit from such pointless carnage?

At the time of writing, no group has surfaced even to explain why they launched the assault. Sometime over the next few days we may be offered a website entry or a video message attempting to justify the impossible, but there is no language that can supply a rational basis for such arbitrary slaughter. The explanation, when it is offered, is likely to rely not on reason but on the declaration of an obsessive fundamentalist identity that leaves no room for pity for victims who do not share that identity.

Yesterday the prime minister described the bombings as an attack on our values as a society. In the next few days we should remember that among those values are tolerance and mutual respect for those from different cultural and ethnic backgrounds. Only the day before, London was celebrating its coup in winning the Olympic Games, partly through demonstrating to the world the success of our multicultural credentials. Nothing would please better those who planted yesterday's bombs than for the atrocity to breed suspicion and hostility to minorities in our own community. Defeating the terrorists also means defeating their poisonous belief that peoples of different faiths and ethnic origins cannot coexist.

In the absence of anyone else owning up to yesterday's crimes, we will be subjected to a spate of articles analysing the threat of militant Islam. Ironically they will fall in the same week that we recall the tenth anniversary of the massacre at Srebrenica, when the powerful nations of Europe failed to protect 8,000 Muslims from being annihilated in the worst terrorist act in Europe of the past generation.

Osama bin Laden is no more a true representative of Islam than General Mladic, who commanded the Serbian forces, could be held up as an example of Christianity. After all, it is written in the Qur'an that we were made into different peoples not that we might despise each other, but that we might understand each other.

Bin Laden was, though, a product of a monumental miscalculation by western security agencies. Throughout the 80s he was armed by the CIA and funded by the Saudis to wage jihad against the Russian occupation of Afghanistan. Al-Qaida, literally "the database", was originally the computer file of the thousands of mujahideen who were recruited and trained with help from the CIA to defeat the Russians. Inexplicably, and with disastrous consequences, it never appears to have occurred to Washington that once Russia was out of the way, Bin Laden's organisation would turn its attention to the west.

The danger now is that the west's current response to the terrorist threat compounds that original error. So long as the struggle against terrorism is conceived as a war that can be won by military means, it is doomed to fail. The more the west emphasises confrontation, the more it silences moderate voices in the Muslim world who want to speak up for cooperation. Success will only come from isolating the terrorists and denying them support, funds and recruits, which means focusing more on our common ground with the Muslim world than on what divides us.

The G8 summit is not the best-designed forum in which to launch such a dialogue with Muslim countries, as none of them is included in the core membership. Nor do any of them make up the outer circle of select emerging economies, such as China, Brazil and India, which are also invited to Gleneagles. We are not going to address the sense of marginalisation among Muslim countries if we do not make more of an effort to be inclusive of them in the architecture of global governance.

But the G8 does have the opportunity in its communique today to give a forceful response to the latest terrorist attack. That should include a statement of their joint resolve to hunt down those who bear responsibility for yesterday's crimes. But it must seize the opportunity to address the wider issues at the root of terrorism.

In particular, it would be perverse if the focus of the G8 on making poverty history was now obscured by yesterday's bombings. The breeding grounds of terrorism are to be found in the poverty of back streets, where fundamentalism offers a false, easy sense of pride and identity to young men who feel denied of any hope or any economic opportunity for themselves. A war on world poverty may well do more for the security of the west than a war on terror.

And in the privacy of their extensive suites, yesterday's atrocities should prompt heart-searching among some of those present. President Bush is given to justifying the invasion of Iraq on the grounds that by fighting terrorism abroad, it protects the west from having to fight terrorists at home. Whatever else can be said in defence of the war in Iraq today, it cannot be claimed that it has protected us from terrorism on our soil.

r.cook@theguardian.com