The United States has confirmed that its envoy met the Taliban in Qatar as Washington seeks to negotiate an end to the 17-year-old war in Afghanistan.

Zalmay Khalilzad, US special representative on Afghan reconciliation, on Tuesday, met Taliban representatives in the Qatari capital Doha, the US State Department said.

"We can confirm that Special Representative Khalilzad and an inter-agency team are in Doha today talking with representatives of the Taliban," a State Department spokeswoman said, adding that the talks were taking place over two days.

The Taliban and the US envoys have officially met four times since July, in an attempt to find a negotiated settlement to the war in the embattled country.

However, Wednesday's comments mark the first time the US State Department has confirmed his meetings directly.

The meeting came even though the Taliban claimed responsibility for an attack on Tuesday against an Afghan intelligence base in central Wardak province.

A local official said at least 65 people were killed in the latest high-casualty attack in Afghanistan.

Longest war involving US

Taliban officials who were privy to the peace talks said US officials taking part were concerned about deteriorating security and feared that a US troop withdrawal could lead to "terrorist groups" taking control in Afghanistan.

A Taliban spokesman announced the meeting with Khalilzad on Monday, saying that the US accepted an agenda of "ending the occupation of Afghanistan and preventing Afghanistan from being used against other countries in the future."

"The message from the Taliban spokesperson was that the talks are specifically aimed at extracting a deadline for the American pullout from Afghanistan," Imtiyaz Gul, from the Centre for Research and Security Studies in Islamabad told Al Jazeera.

President Donald Trump has ordered a halving of the 14,000 US troops in Afghanistan as he voices eagerness to end the US's longest-ever war, launched in 2001 after the September 11 attacks.

The Afghan-born Khalilzad, a key US policymaker under former president George W Bush, met the Taliban after talks in Afghanistan as well as stops in key regional players China, India and Pakistan.

In Kabul, Khalilzad spoke with President Ashraf Ghani and vowed that the US would maintain security support to Afghan forces.

"We agreed military pressure is essential while we prepare to engage in negotiations for peace," he tweeted.

He elaborated later: "To achieve peace, we are ready to address legitimate concerns of all Afghan sides in a process that ensures Afghan independence and sovereignty, and accounts for legitimate interests of regional states."

"Urgent that fighting end. But pursuing peace still means we fight as needed," he tweeted.

Khalilzad is last known to have met the Taliban last month in Abu Dhabi, capital of the United Arab Emirates, which has jockeyed for influence versus Gulf rival Qatar on spearheading diplomacy with the Taliban.