I used to look out from the balcony of a first floor room in the al-Hamra hotel in Baghdad thinking that one day the hotel would be attacked and wondering from which direction the attack would come.

The general consensus among the correspondents and security men in the Hamra, which boasted 65 armed guards, was that the weak point in our defences was the single blast wall about 30 yards from the back of the hotel. On the other side of it was a public car park which anybody could enter.

The consensus view turned out to be all too correct. I was out of the hotel on 18 November 2005 when two vehicles driven by suicide bombers entered the car park. The first rammed the concrete wall and detonated his explosives, the idea being that the blast would open a breach enabling the second vehicle, packed with 1,000kg of explosives to reach the hotel.

It almost worked, but the crater created by the first bomb was so deep that the second bomber could not get through. He blew himself up just short of his target, killing half a dozen people and badly damaging this part of the hotel which has never been reoccupied.

We never knew the identity of the two men who had died trying to kill us, but at that time most of the suicide bombers were Saudis, Yemenis, Egyptians and Libyans. I had been emphasising for several years that the Iraqi insurgency against the US occupation was essentially home grown.

Aside from the suicide bombers themselves, almost all the guerrilla fighters who were launching attacks on American troops and fledgling Iraqi government forces were Iraqi. Most of them had been trained militarily in Saddam Hussein's army or security forces.

At that time the White House and the Pentagon were still ludicrously pretending that the Sunni Arab uprising which spread so fast after the summer of 2003 was a mixture of foreign fighters and "remnants" or "dead enders" of the old regime. It was easy enough for me and other correspondents to pour scorn on this idea. Iraq was full of weapons and every household owned one. No foreign suppliers were needed. Whenever there was a successful ambush of US troops in a Sunni area, local people would dance with joy amid the blazing vehicles.

We were essentially right about the rebellion being home grown, but perhaps we should have emphasised more the significance of foreign support for the rebels. The American neo-cons were openly boasting that after overthrowing Saddam, the Iranian and Syrian regimes were next on the US list. Not surprisingly, both governments had an incentive to make sure US rule in Iraq never stabilised.

Nor were they alone. All the conservative Sunni Arab regimes of the Middle East were alarmed by an American land army in Iraq in support of a Shia-Kurdish government. The anti-American guerrillas found they had many friends.

In the immediate aftermath of the murderous attacks in Mumbai much of the analysis has a familiar ring, but now it is the West which is downplaying foreign involvement. Indian allegations about "external linkages" of the terrorists is wearily reported as an unfortunate resumption of Pakistani-Indian finger pointing.

Television and newspaper commentary on terrorist outrages is frequently provided by self-appointed "terrorist experts" whose credentials remain mysterious. These supposed experts now emphasise the alienation of Indian Muslims and suggesting that the origin of the terrorist assault on Mumbai is home grown, the fruit of the radicalisation of Indian Muslims by systematic discrimination against them by the Indian state. Exactly who was behind the bloody mayhem in Mumbai is still unclear. The Hindu newspaper was yesterday reporting that three of the suspects captured by the police were members of Lashkar-i-Taiba (the Army of the Pious), which has several thousand members in Pakistani-controlled Kashmir, and the gunmen had arrived In Mumbai by ship from Karachi in Pakistan. The group is one of the three largest fighting against India in Kashmir.

The origins and motives of the men who slaughtered so many people in Mumbai will emerge in the coming days. But already the butchery should be underlining one of the greatest of the many failings of the Bush administration post-9/11. Pakistan was always the real base for al-Qa'ida. It was the Pakistani ISI military intelligence which fostered and partly directed the Taliban before 2001 and revived it afterwards.

It is Pakistan which has sustained the Islamic jihadi fighters in Kashmir where half the Indian army is tied down. Yet the Bush administration in its folly allied itself to General Pervez Musharaf and the Pakistani army post-9/11, ensuring that jihadi groups always had a base.

It is self-defeating hypocrisy for the West to lecture the Indian government now about not over-reacting and not automatically blaming the Pakistani government or some part of its security apparatus for Mumbai. The way in which the Pakistani military has allowed Kashmiri and Pakistani militants free range in Pakistan created the milieu from which the attacks this week came. It may be that the monster the ISI created is no long under its control, but it is ultimately responsible for what has happened.

The real political background to Mumbai is succinctly summed up by Ahmed Rashid in his excellent book Descent into Chaos: How the War against Islamic Extremism Is Being Lost in Pakistan, Afghanistan and Central Asia. In Pakistan, he writes, "a nuclear-armed military and an intelligence service that have sponsored Islamic extremism as an intrinsic part of their foreign policy for nearly four decades have found it extremely difficult to give up their self-destructive and double-dealing policies". Unless Barack Obama can persuade them to do so he will achieve no more as president than Mr Bush.