ISLAMABAD (Reuters) - Pakistan’s army on Thursday threw its support behind the latest U.S. efforts for a political settlement with the Afghan Taliban to end a 17-year-old war, urging Washington to leave Kabul as a friend of the region rather than a “failure”.

The comments by Pakistan’s army spokesman, Major-General Asif Ghafoor, came just after the U.S. special representative for Afghanistan, Zalmay Khalilzad, concluded a visit to the Pakistani capital of Islamabad.

“As much as we can, we will facilitate,” Ghafoor told a news conference in the garrison city of Rawalpindi, replying to a query about what Pakistan could do to help the United States negotiate a political settlement with the Taliban.

“What the U.S. is expecting from us, and the foreign office is cooperating with, is that somehow they could have these negotiations with them (Taliban).”

Ghafoor added, “We wish that (the) U.S. leaves Afghanistan as friend of the region, not as a failure.” He did not elaborate.

Khalilzad, an Afghan-born veteran U.S. diplomat who served as George W. Bush’s ambassador to Afghanistan, Iraq and the United Nations, was named by the Trump administration three months ago as a special envoy to negotiate peace.

His visit to Pakistan followed a request from U.S. President Donald Trump to Prime Minister Imran Khan seeking assistance in moving forward peace talks. The overture to Khan came after an exchange of barbed tweets between the leaders last month.

Washington has long been pushing Islamabad to lean on Taliban leaders, who it says are based in Pakistan, to bring them to the negotiating table.

It often accuses the south Asian nation of covertly sheltering Taliban leaders, an accusation Islamabad vehemently denies.

Khan, who enjoys the support of Pakistan’s powerful army, which dominates foreign policy, met Khalilzad earlier in the week and also pledged to support a peace process with the Taliban.

The United States, which had more than 100,000 troops in Afghanistan at its peak during the first term of former President Barack Obama, withdrew most of them in 2014 but still keeps around 14,000 there.