The invasion of Iraq triggered a massive upsurge in terrorist activity against the UK, the former head of MI5 said today.
Baroness Manningham-Buller said the Security Service had been forced to seek a doubling of its budget as it struggled to cope with the volume of plots generated in the aftermath of the invasion in 2003.
Giving evidence to the official inquiry into the conflict, she said ministers had been warned that the launch of military action against Iraq would lead to a heightened prospect of attack by al Qaida.
However she acknowledged that MI5 had been slow to appreciate that the main threat would come from "home-grown" terrorists.
Lady Manningham-Buller - who is the only member of the intelligence agencies, past or present, to give evidence to the inquiry in public about their work - was scathing about the way intelligence was used to make the case for war.
The evidence of Saddam Hussein's supposed weapons of mass destruction (WMD) had been "fragmentary", she said, and she dismissed Tony Blair's argument that action had been necessary to prevent them falling into hands of terrorists.
She disclosed that MI5 had refused to contribute to the Government's dossier on Iraqi WMD in 2002 and she criticised the way that the invasion had shifted attention away from the al Qaida threat in Afghanistan.
The toppling of Saddam had, she suggested, also given al Qaida a foothold in Afghanistan for the first time. "Arguably we gave Osama bin Laden his Iraqi jihad," she said.
Following the hearing, her comments were echoed by the head of the Royal Navy at the time of the invasion, Admiral Lord West of Spithead, who described the military action as "foolhardy".
Lady Manningham-Buller said that MI5 had assessed as early as 2002 that Iraqi intelligence agents in the UK would not pose much of a threat in the event of military action against Saddam.
"That turned out to be the right judgment. That is partly as a result of the action we took," she said.
The agency had, however, warned ministers through the assessments of the Joint Intelligence Committee - Britain's senior intelligence body - that an invasion would lead to an increased threat from al Qaida.
While they had seen a build up terrorist activity following the 9/11 attacks in the United States in 2001, she said that the threat had increased "substantially" in the wake of the military intervention in March 2003.
She suggested that "a whole generation of young people" had been "radicalised" by what they saw as an attack on Islam, before quickly correcting herself to say: "Not a whole generation, a few among a generation".
At times, she said, MI5 had been almost overwhelmed by the number of terror plots that sprung up.
"We were pretty well swamped - that's possibly an exaggeration - but we were very overburdened with intelligence on a broad scale that was pretty well more than we could cope with in terms of plots, leads to plots and things that we needed to pursue," she said.
Despite having seen MI5's budget increase immediately following the 9/11 attacks and then again in 2002, Lady Manningham-Buller said that she had to ask Mr Blair for a further doubling of its resources in 2003.
"This is unheard of, certainly unheard of today, but he and the Treasury and the chancellor accepted that because I was able to demonstrate the scale of the problem that we were confronted by," she said.
She accepted that MI5 had not foreseen the extent to which British citizens - some third generation UK nationals - would become involved in terrorist plots against their own country.
"During 2003-04 we realised that the focus was not foreigners. The rising and increasing threat was a threat from British citizens and that was a very different scenario to, as it were, stopping people coming in," she said.
As well as those involved in terrorist attacks at home, she said that MI5 believed that around 70 or 80 British nationals travelled to Iraq to join the insurgency against the international forces.
Lady Manningham-Buller, however, dismissed Mr Blair's argument that Britain and the US had needed to take action against Saddam following 9/11 to prevent his supposed chemical and biological weapons being obtained by terrorists.
"It's a hypothetical theory. It certainly wasn't of concern in either the short term or medium term to my colleagues and myself," she said.
Lady Manningham-Buller was critical of the way that "fragmentary" intelligence - most of it from the Secret Intelligence Service, MI6 - had been used by the Blair government to make the case for war.
"If you are going to go to war, you need a pretty high threshold, it seems to me, to decide on that and I think there is very few who would argue that the intelligence was not substantial enough on which to make that decision," she said.
She said that MI5 had been asked to contribute to the government's Iraq weapons dossier but had declined.
"We were asked to put in some low-grade, small intelligence to it and we refused because we didn't think it was reliable," she said.
She said that the military commitment in Iraq had also meant that insufficient attention was paid to the problems in Afghanistan where international forces were also deployed.
"By focusing on Iraq we reduced the focus on the al Qaida threat in Afghanistan. I think that was a long-term major and strategic problem," she said.
Following the hearing, Lord West - who went on to become security minister in the Labour government - told BBC Radio 4: "I was never a supporter, I have to say, of going into Iraq. I think it was a foolhardy thing to do when we were already engaged in Afghanistan."