Horror, exactly as foretold. All we didn't know was that 7/7 would be the date. Every Londoner imagined this over and over in every rush-hour train and crowded bus, glancing warily at one another, eyeing packages and bags. Only a matter of time.

After Madrid's 10 terrible blasts during their election, how could London escape? "When not if", the head of counter-terrorism said long ago. Tony Blair himself echoed those words, "When not if". So throughout the election we waited and feared, but it never came. There were only black alerts on public buildings, no sinister terrorist "chatter" detected by security services. So maybe our intelligence services really were able to listen and prevent calamity, it was hoped. It began to feel almost safe.

Assumed to be the work of al-Qaida, no doubt this will again be greeted with glee in some Middle Eastern streets, as was the fall of the twin towers. There will be renewed suspicion that fifth columnists may also be punching the air in some extreme parts of Muslim communities around Europe too. Yet in a way it hardly matters who did it or why.

Random atrocity has become part of the modern weather, almost as devoid of meaning as typhoons. The minds of those who did it seem too remote to understand, too unknowable a twister to summon up much rage or thirst for revenge. A thousand questions about fanaticism will go for ever unanswered. Of course we must detect, prevent and expunge it as best we can - but it is a monstrous force of unreason beyond arguing with. The rich west may always be subject to waves of it from time to time, whether they come dressed in banners of nationalism, religion or any other demented isms and cults. Until wealth and democracy is more evenly spread this may stay part of modern climate change, a price to be paid.

What bitter irony and terrible perfection of timing this was, just as London celebrated its glorious, unexpected Olympic win. Many thought the Olympic bid impossible because of Britain's part in the Iraq war. Surely Paris would win, with most of the world anti-war, anti-Bush and hostile to Blair? But on Wednesday in Singapore it seemed that anti-British feeling was fading. Live 8 gave us back some moral fame. Anti-war voters here were warming to Labour's bold attempt at rallying the world for Africa and climate change.

Yesterday morning I was sitting down to write hosannas to our magnificent capital and its radiant revival in the last decade. Instead the shriek of sirens was quickly followed by shocking images of people streaming blood from blackened faces. All over London frantic calls struggled to reach all in danger: Where are you? Where is he, where is she? The mobile phone system collapsed under the strain amid universal imaginings of loved ones trapped under twisted trains.

But as the dust cleared, the true wonder was how relatively few are dead and badly injured. The worst nightmare was always bombs on the tube in rush hour and this was the worst UK death toll, but four bombs might have massacred thousands. London is not given to panic, with memories of IRA bombs hard-wired into general consciousness. Its millions of denizens have a certain canny elan, accustomed to hard-headed calculations of the odds against being one of the unlucky few in the wrong place at the wrong time. Remember how we mocked Sylvester Stallone and other macho-muscled Hollywood stars who refused to fly to London for fear of bombs, unable to make that simple risk assessment.

How barbaric, Tony Blair rightly said, that the terrorists should strike just as the G8 at least strives to do better on Africa and climate change. Yes indeed. But then barbarism is in the eye of the beholder and every act of war is justified in the warped minds of its perpetrators. Barbaric might also be 30,000 children a day dying in Africa while a mere 25,000 US cotton farmers keep their trade-denying subsidies. Or Bangladesh soon to be washed away in global-warming floods. Or arms sold to those who will force them upon child soldiers, or any number of worldwide atrocities.

Who is to blame? Those who planted the London bombs, of course. But during the election it was often thought that any terrorist outrage might find Tony Blair blamed at the polls for taking us to a war that most now think not in our interests and probably not in Iraq's or the world's either. However, that always seemed most unlikely. Almost every precedent suggests that bombs summon up the opposite response, an understandable rallying round.

Instead ID cards may get an easier passage now that they can show a clearer purpose. Where the security services and intelligence plainly failed abysmally to detect any of the elaborate planning for this atrocity, attention may turn to sterner measures against the hundreds of thousands of foreigners living here illegally. London won the Olympics partly because of its vast melting pot of languages and nationalities, but that very strength may suddenly seem threatening in public perceptions. Do we know who is here and why? The fear is of backlash against Muslims. Though just possibly this horror might see the BNP off, in a mood of broad cross-party solidarity.

George Bush is the one person who could and should have felt beholden to give a good response to this disaster, in support of his ally. But with typical inadequacy it was beyond his imaginative grasp to be extra magnanimous either to Blair or to the world in his offers on climate change, aid and trade. What a fine contrast it would have made to the bombers if this had redoubled the west's determination to do the right thing. It would not be giving in to terrorism, but denying it the oxygen of justification.

No doubt, as usual, many will use these attacks as an excuse to justify their own stance: Bush will call for renewed efforts in his war on terror; Putin can redouble his war on Chechnya. Berlusconi can only quake at yesterday's apparent extra threat to attack Italy next. There will be a thinly veiled "I told you so" from some. George Galloway was quick to say yesterday that many had warned this would be a result of the war. However, risk plainly did not determine the Olympic decision.

I was about to revel in London's success today. I was hoping to delay for at least one day longer our inevitable return to laconic cynicism and general self-destructiveness. All too soon, I thought, we will be grumbling over the cost, almost willing a Dome-like failure, so I was settling down to celebrate London the magnificent and the city's remarkable reinvention of itself in the last decade. But maybe now the bombs will give the Olympics an established pride of place in the national psyche, setting aside the usual "Nothing works" (even in the Evening Standard). The Olympics may now turn into an iconic memorial for those who died and were injured yesterday.