General David Richards said the national security of Britain was still at stake, but the threat could be contained to allow Britons to lead secure lives.
In an interview with The (London) Sunday Telegraph, he also revealed that Prince William was unlikely to serve in Afghanistan, but he suggested that Prince Harry could return to frontline duty in the campaign as a helicopter pilot.
The commander was speaking before the Remembrance Sunday ceremony in Whitehall, England, where he will lay a wreath in memory of Britain's war dead.
"Make no mistake, the global threat from Al Qaeda and its terrorist affiliates is an enduring one and one which, if we let it, will rear its head in states, particularly those that are unstable," Richards, 58, told the newspaper. "The national security of the UK, and our allies, is in my judgment, at stake."
He added: "In conventional war, defeat and victory is very clear cut and is symbolized by troops marching into another nation's capital.
"First of all you have to ask: do we need to defeat it [Islamist militancy] in the sense of a clear cut victory? I would argue that it is unnecessary and would never be achieved," Richards said. "But we can contain it to the point that our lives and our children's lives are led securely? I think we can."
Richards said the sacrifice being made by British troops in Afghanistan, where 343 soldiers have been killed since 2001, "has been worth it."
"If I thought for one minute that the majority of the Afghan people didn't want us any more -- then I and everyone else would say that it's time to go, we've failed. But there is no indication of that," he said.