The UK government will work with the Taliban's leaders if they took places in the government in Afghanistan, British Defence Secretary Ben Wallace has said.
After 20 years of war, the UK would accept their former enemies sharing power in Afghanistan, as long as certain international obligations were upheld, Mr Wallace said.
Speaking in Washington, where he was visiting US Defence Secretary Lloyd Austin, he said the Taliban would be unlikely to make the mistakes of the past.
Mr Wallace said the Taliban would understand that if they gave terrorists havens from which to attack the West, they would be subject to overwhelming military action, as they were after the 9/11 attacks when they were driven from power.
The lessons of the past 20 years “will not have been lost on the Taliban", he said.
Mr Wallace acknowledged that the group would probably have a role in the future governance of Afghanistan.
“Whatever the government of the day is, provided it adheres to certain international norms the UK government will engage with it,” he said.
“Just like other governments around the world, if they behave in a way that is seriously against human rights we will review that relationship."
Mr Wallace recognised that the prospect of the UK working with the group responsible for the deaths of 457 British personnel would be controversial, but said pragmatism could be the foundation for lasting peace.
“Afghan veterans will be asking themselves about the Taliban," he said. "All peace processes require you to come to terms with the enemy. Sometimes, that's what it is.
He said the Taliban was desperate for "international recognition".
"They need to unlock financing and support for nation building, and you don't do that with a terrorist balaclava on," he said.
“You have to be a partner for peace otherwise you risk isolation. Isolation led them to where they were last time.
“The poverty of their own people is an important issue to be dealt with and you cannot deal with that on your own in isolation. When you're one of the poorest nations on earth, you need the help of the international community.”
The Taliban, which ruled Afghanistan from 1996 to 2001, has been fighting for 20 years to topple the Western-backed government in Kabul.
A Taliban offensive has put Afghan security forces on the back foot as the US and its Nato allies end their 20-year military presence.
The Nato withdrawal led to fears that Afghan security forces would be overrun in a "Saigon moment" echoing the fall of South Vietnam in 1975.
Taliban officials said last week the group had taken control of 85 per cent of territory in Afghanistan.
Not all opponents to the existing government were “card-carrying Taliban”, he said. Referring to recent reports that China may be trying to extend its influence in Afghanistan, he said: “Two superpowers learnt Afghanistan is not to be taken for granted.”
“China has been quick to offer itself as a superpower. I don't need to remind them of the consequences.”
Mr Wallace urged the Taliban and Afghanistan’s president Ashraf Ghani to work together to bring stability to the country after decades of conflict.
“Now is the time for both of them to show leadership and bring together Afghanistan," he said. “The Taliban is not one single unit. There are lots of views within the Taliban, lots of tribes.
“The best way to gauge the Taliban, from our point of view at the moment, is formally through the international system. The Americans have been engaging with them and on behalf of their allies as well.
"We speak regularly to the Pakistani government, the Pakistani military and intelligence services, and they understand how to use their influence, hopefully in a way that is in agreement with us.
“But in the end, if there is a government, and it is a government of both, and we have committed to a diplomatic relationship, then that's exactly what it will be.”