LONDON  The former director general of Britain’s domestic intelligence agency said Tuesday that the wars in Iraq and Afghanistan had greatly increased the terrorist threat to Britain and that intelligence available before the Iraq war had not been sufficient to justify the invasion of that country.

“Our involvement in Iraq, for want of a better word, radicalized a whole generation of young people  not a whole generation, a few among a generation  who saw our involvement in Iraq, on top of our involvement in Afghanistan, as being an attack on Islam,” said the former official, Baroness Manningham-Buller.

Lady Manningham-Buller, who led MI5, roughly the British equivalent of the F.B.I., from 2002 to 2007, made her remarks in testimony to a panel investigating the events leading to the invasion of Iraq in 2003. The panel, led by Sir John Chilcot, has heard from a variety of witnesses, including Sir Richard Dearlove, the former leader of MI6, Britain’s foreign intelligence agency, and former Prime Minister Tony Blair.