Islamabad: Pakistan’s military has warned Donald Trump’s new generals that they face a “total mess” in Afghanistan unless America and Britain can halt the advance of [Daesh] and the Taliban.

In an interview with The Daily Telegraph, a senior Pakistani army source said the collapse in security since the drawdown of Western troops meant the West now faced “losing control”.

If Daesh and the Taliban continued to gain strength, he added, it could tempt Russia to stage a Syrian-style intervention, this time on the pretext of protecting its “backyard” in Central Asia.

The comments will add to growing concern in Washington and London about the reversal of the hard-won gains made by coalition troops during the 16-year Afghan campaign.

Districts of Helmand province, where more than 100 British troops died, have again slipped from Kabul’s control, while in east Afghanistan, militants are regrouping under Daesh.

Neighbouring Pakistan was long accused of backing the Taliban and other militant groups through its powerful security establishment.

But increasing terrorist attacks on Pakistan itself has led to the army launching massive operations in the past two years to clear extremists from its mountainous Afghan border.

With Islamabad seeing itself an equal partner in the war on terror, Pakistan’s generals fear their own efforts to fight militants — which have cost the lives of nearly 4,000 troops — will be jeopardised by setbacks in Afghanistan.

Such claims may get limited sympathy in Washington.

Last month, General John Nicholson, the head of US and Nato forces in Afghanistan, told Congress that certain Afghan militant groups, including the Taliban, still enjoyed sanctuary in Pakistan.

“It is very difficult to succeed on the battlefield when your enemy enjoys external support and safe haven,” he said.

The source within the Pakistani army, which has 180,000 troops on the Afghan border, said that in recent weeks, discussions had taken place with Gen Nicholson and James Mattis, the retired US general appointed by Trump as secretary of defence.

Gen Nicholson admitted last month that Afghan forces — which are mentored by a scaled-down coalition force of 13,000 — were now in a “stalemate” against the Taliban.

The Pakistani source said even that was an “optimistic” assessment.

“A stalemate is still a win for the Taliban,” he said.

“We have told Gen Mattis that Afghanistan is slipping out of control, and that if things are not put right, America will have a huge crisis on its hands. [Daesh] is also developing there, and if they leave Syria and Iraq, the next place to gather is Afghanistan.”

Pakistan has criticised the Kabul government for not doing enough to seal its side of the Afghan border, from where Islamabad says militants are now launching attacks on both Pakistani and Afghan soil.

Last month, 88 people died in an attack on a religious shrine in Pakistan claimed by Daesh.

Islamabad admits that Kabul is limited by the Afghan National Army, which is part-trained by a 500-strong British troop contingent.

British claims about the success of its “Sandhurst in the Sand” programme are not shared by Pakistan.