Dominic Raab’s diplomatic tour to assist Afghans wanting to flee the Taliban has come to an end, as attention begins to switch to Westminster.

The Foreign Secretary departed Pakistan after holding talks with his counterpart Makhdoom Shah Mahmood Qureshi, prime minister Imran Khan and the country’s army chief.

Mr Raab also visited Torkham, a major border crossing between Pakistan and Afghanistan, to see the “challenge” faced from a “humanitarian perspective”.

He went on: “But also for British nationals or Afghan workers for the UK Government that are trying to make their way across the border.

“We talked about the practical arrangements for ensuring safe passage across the border into Pakistan and other third countries.”

Mr Khan’s office said the Pakistan prime minister highlighted the need to “stabilise the security situation in Afghanistan, take steps to consolidate peace, and preclude any mass exodus”.

A statement added he also “cautioned against the role of ‘spoilers’, both inside and outside Afghanistan, which could destabilise the situation”.

With the airport in Afghanistan’s capital of Kabul still closed, Pakistan is crucial in the mission to help people flee Afghanistan because the two nations share a land border.

The House of Commons will return from its summer recess on Monday, with Mr Raab and Prime Minister Boris Johnson expected to come under renewed pressure to explain their response to the crisis and to explain how they will help more people leave the country.

More than 8,000 former Afghan staff and their family members eligible under the Afghan relocations and assistance policy (Arap) were among the 15,000-plus people evacuated by the UK since August 13.

But thousands of Afghans who helped British efforts in the nation and their relatives, as well as other vulnerable civilians, are feared to have been left behind.

Mr Raab, who has been criticised for holidaying in Crete in August as the Taliban swept to power, used a press conference in Islamabad to claim there was “common widespread surprise” at the pace of change in Afghanistan.

He said: “The takeover, I think it’s fair to say, was faster than anyone anticipated, not just the United Kingdom or Nato allies, but I was talking with our friends here.

“And I suspect the Taliban and ordinary Afghans were taken by surprise.

“I think there was a common widespread surprise at the speed with which the consolidation of power happened.”

These remarks differed to Mr Johnson, who claimed it had been “clear for many months” that the situation in Afghanistan could change “very fast”.

Mr Raab also visited Qatar and held talks with Tajikistan foreign minister Sirojiddin Muhriddin during his visit to the region to assess the crisis.

Sir Simon Gass, the Prime Minister’s special representative for Afghan transition, has also held talks with the Taliban.

Elsewhere, Mr Johnson again insisted any recognition of the Taliban is dependent on them “upholding human rights” and allowing safe passage for people wanting to leave Afghanistan.

Following talks between the Prime Minister and his Dutch counterpart Mark Rutte, a Downing Street spokesman said on Friday evening: “They discussed the situation in Afghanistan and agreed on the need for a co-ordinated international effort to prevent a humanitarian emergency in the region.

“The leaders both stressed that any recognition of the Taliban must be predicated on them upholding human rights and allowing safe passage out of the country.

“They agreed to work together to re-establish an international diplomatic presence in Afghanistan as soon as the political and security environment allows.”