Defeat for allied forces in Afghanistan would have an "intoxicating impact" on extremists around the world, the new head of the British Army has warned.
Gen Sir David Richards said the failure of a coalition of such powerful western nations would show terrorists that "anything might be possible".
In a near simultaneous speech a top US commander acknowledged that violence in Afghanistan was getting worse.
But Gen David Petraeus also said the mission was "do-able".
In his first major speech since taking over last month as the Chief of the General Staff, Gen Richards said defeat would have an "enduring grand strategic impact" on Britain's global reputation.
Speaking at London's Chatham House, he also said he was optimistic the allies would get the strategy right.
Defeat could have an "alienating and potentially catalytic effect" on millions of Afghans, he said.
He also said failure could provoke a resurgence of al-Qaeda-inspired terrorism and the spread of instability to nuclear-armed Pakistan.
Gen Richards said: "Add to that the hugely intoxicating impact on extremists world-wide of the perceived defeat of the USA and Nato - the most powerful alliance in the history of the world - and the debilitating impact on these countries.
Gen Petraeus acknowledged that violence was getting worse
"Anything might then be possible in their eyes and that's what we should expect, despite the skill and courage of our police, intelligence and security services.
"On a different note entirely, factor in the enduring grand strategic impact on the UK's authority and reputation in the world of the defeat of the British Armed Forces, and its impact on public sentiment here in the UK."
Gen Petraeus, who heads US Central Command, said in a separate lecture at London's Policy Exchange think tank that the Taliban had "expanded their strength and influence, particularly in places which lack Afghan security forces".
"They benefit from reasonable freedom of movement in border areas, funding their activities from the narcotics industry and donations," he said.
But he added: "The challenges in Afghanistan are significant, but the stakes are also high, and while the situation unquestionably is serious, the mission is still do-able."
'Horse and tank moment'
Gen Richards said the war in Afghanistan was a "signpost" indicating the nature of wars in the future - "asymmetric" conflicts with less need for traditional military hardware like tanks and warplanes.
He said globalisation meant future conflicts were more likely to involve non-state actors and failed states, like Afghanistan, rather than traditional wars between states.
"How we deal with the threat posed by violent extremism, often embedded in dangerously radicalised states, will be an issue that will dominate our professional lives," he said.
In the future attacks are more likely to come via "the use of guerrillas and Hezbollah-style proxies," he said.
This in turn would influence the shape of the military, which he said is facing a "horse and tank moment", in which traditional combat power is often being rendered "irrelevant".
Gen Richards' speech coincides with comments from a British general that Afghan insurgents could be paid to lay down their weapons and stop fighting.
Lt Gen Sir Graeme Lamb, who is tasked with overseeing a programme of reconciliation with moderate elements of the Taliban, told the BBC the "vast majority" of the Taliban were "guns for hire" motivated by money.
The former special forces commander said it was his belief that "you can buy an insurgency if you have enough money".
Earlier the Ministry of Defence revealed that a total of 71,560 members of Britain's armed forces have served in Afghanistan since 2001.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.