Iraq posed no threat to the UK when then prime minister Tony Blair took Britain to war in 2003, former MI5 boss Baroness Manningham-Buller has said.
In a Radio Times interview, Baroness Manningham-Buller said the service advised war was likely to increase the domestic threat and was a "distraction" from the pursuit of al-Qaeda.
But she said it was "for others to decide" whether the war was a mistake.
She also said she "assumed" there would be another terrorist attack on Britain.
Baroness Manningham-Buller, who was director-general of MI5 from October 2002 until her retirement in April 2007, will deliver the first of her 2011 BBC Reith Lectures later this week.
She told the Radio Times: "Iraq did not present a threat to the UK.
"The service advised that it was likely to increase the domestic threat and that it was a distraction from the pursuit of al-Qaeda. I understood the need to focus on Afghanistan. Iraq was a distraction."
But she added: "Intelligence isn't complete without the full picture and the full picture is all about doubt."
Baroness Manningham-Buller also described Colonel Muammar Gaddafi as "a horror".
"It's very difficult - do you just stand by and watch people being murdered?", she said, referring to military interventions.
Asked about Britain's friendlier approach to Col Gaddafi in the recent past, she replied: "There was a point to cosying up to him, to get him to forfeit his stockpiles of WMD (weapons of mass destruction).
"It was the right thing to do. But yes, you do have to be aware of who you're dealing with."
The former director-general also defended MI5 against suggestions that it could have prevented the 7 July 2005 terror attacks on London.
"In intelligence, you can know of someone, without knowing exactly what they are going to do.
"The next time there is an attack, the same could be true - though I hope it won't be."
Baroness Manningham-Buller added that she "assumed" there would be another terrorist attack on Britain.
"This isn't a war you win in a military sense, and you can't anticipate everything," she said.
Baroness Manningham-Buller led the British security service through substantial change in the wake of 9/11 and the growing threat from al-Qaeda.
She is delivering the second phase of this year's Reith Lectures - which are being broadcast in September 2011 to coincide with the tenth anniversary of the 9/11 attacks on New York and Washington DC.
Across the three lectures she will assess the post-9/11 world, and will consider the role of security intelligence, reflecting on the threats to freedom and the means of countering them, as well as the implications for foreign policy.
Aung San Suu Kyi, the Burmese pro-democracy leader, delivered the first phase of the 2011 BBC Reith Lectures on 28 June and 5 July.