The invasion of Iraq "substantially" increased the terrorist threat to the UK, the former head of MI5 has said.
Giving evidence to the Iraq inquiry, Baroness Manningham-Buller said the action had radicalised "a few among a generation".
As a result, she said she was not "surprised" that UK nationals were involved in the 7/7 bombings in London.
She said she believed the intelligence on Iraq's threat was not "substantial enough" to justify the action.
Baroness Manningham-Buller said she had advised officials a year before the war that the threat posed by Iraq to the UK was "very limited", and she believed that assessment had "turned out to be the right judgement".
Describing the intelligence on Iraq's weapons threat as "fragmentary", she said: "If you are going to go to war, you need to have a pretty high threshold to decide on that."
In a previously secret document from 2002, Baroness Manningham-Buller wrote to the Home Office saying: "We assess that Saddam is only likely to order terrorist attacks if he perceives that the survival of his regime is threatened."
The Chilcot inquiry is continuing to hear evidence about decisions taken in the build-up to the invasion and its aftermath.
Baroness Manningham-Buller, head of the domestic intelligence service between 2002 and 2007, said the terrorist threat to the UK from al-Qaeda and other groups "pre-dated" the Iraq invasion and also the 9/11 attacks in the US.
However, she said the UK's participation in the March 2003 military action "undoubtedly increased" the level of terrorist threat.
A year after the invasion, she said MI5 was "swamped" by leads about terrorist threats to the UK.
"Our involvement in Iraq, for want of a better word, radicalised a whole generation of young people, some of them British citizens who saw our involvement in Iraq, on top of our involvement in Afghanistan, as being an attack on Islam," she said, before immediately correcting herself by adding "not a whole generation, a few among a generation".
The ex-MI5 chief said she shared her concerns that the Iraq invasion would increase the UK's exposure to terrorism with the then home secretary David Blunkett, but did not "recall" discussing the matter with Prime Minister Tony Blair.
MI5 did not "foresee the degree to which British citizens would become involved" in terrorist activity after 2004, she admitted.
"What Iraq did was produce fresh impetus on people prepared to engage in terrorism," she said, adding that she could produce evidence to back this up.
"The Iraq war heightened the extremist view that the West was trying to bring down Islam. We gave Bin Laden his jihad."
Lady Manningham-Buller said MI5 was given a budget increase after 9/11 and again in 2002 but the agency still needed far greater resources as a result of the Iraq invasion.
"By 2003 I found it necessary to ask the prime minister for a doubling of our budget," she said. "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."
Baroness Manningham-Buller was part of the government's Joint Intelligence Committee before the war, which drew up the controversial dossier on Iraq's alleged weapons of mass destruction in September 2002. The dossier stated the weapons could be activated with 45 minutes of an order to do so.
Asked about the dossier, she said she had very limited involvement in its compilation but it was clear, with hindsight, that there was an "over-reliance" on certain intelligence.
She added: "We were asked to put in some low-grade, small intelligence into it and we refused because we did not think that it was reliable."
She said MI5's responsibility was to collect and analyse intelligence and to "act on it where necessary" to mitigate terrorist threats, but stressed it was not her job "to fill in gaps" in the intelligence.
A year before the war, the former MI5 chief advised Home Office officials that the direct threat posed by Iraq to the UK was "very limited and containable".
In a newly declassified document, published by the inquiry, Baroness Manningham-Buller told the senior civil servant at the Home Office in March 2002 that there was no evidence that Iraq had any involvement in the 9/11 attacks.
While there were reports of links between the regime of Saddam Hussein and al-Qaeda, there was no intelligence to suggest meaningful co-operation between the two.
In that letter, she said the possibility Iraq might use terrorist tactics to defend its own territory in the event of an invasion could not be ruled out.
But she stressed Iraqi agents did not have "much capability" to carry out UK attacks, adding her view of this never changed.
In his evidence in January, Tony Blair described Saddam Hussein as a "monster" and said the world was a safer place with him no longer in control of Iraq.