WASHINGTON — The top U.S. military officer said Wednesday it’s too early to talk about a full American troop withdrawal from Afghanistan, injecting a cautionary note as U.S. peace talks with the Taliban appear to be near a final agreement.

Gen. Joseph Dunford, chairman of the Joint Chiefs of Staff, told Pentagon reporters that any U.S. deal with the Taliban will be based on security conditions on the ground and that Afghan forces aren’t yet able to secure the country without help from allied forces.

"I'm not using the withdraw word right now," Dunford said. "It's our judgment that the Afghans need support to deal with the level of violence" in the country today.

Trump promises continued US presence in Afghanistan amid withdrawal talks The president said he wants to bring most U.S. troops home, but still maintain some presence in the war-torn country.

After nearly 18 years of war, Afghanistan’s government expects that U.S. envoy Zalmay Khalilzad will soon update officials in Kabul on the progress of peace talks with the Taliban. A Taliban spokesman has said that they’re close to a final agreement. But even as the talks go on, there are persistent attacks by the Taliban across Afghanistan, and an affiliate of the Islamic State group has taken hold in the country and has been expanding its base.

Even if Khalilzad is able to close a deal, it will remain for the Afghan government to negotiate its own peace agreement with the Taliban. Part of those talks will be determining a role for the Taliban in governing the country that it ruled before U.S. forces invaded in October 2001.

The Taliban, which now control roughly half of Afghanistan and are at their strongest since their 2001 defeat in the U.S.-led invasion, have dismissed the Afghan government as an American puppet.

The U.S. has about 14,000 troops in Afghanistan. They are performing two missions: advising and assisting Afghan defense forces and combating extremist groups like the Islamic State and al-Qaida.

× Fear of missing out? Sign up for the Early Bird Brief - a daily roundup of military and defense news stories from around the globe. Thanks for signing up. By giving us your email, you are opting in to the Early Bird Brief.

President Donald Trump has campaigned on getting the U.S. out of the war, but efforts to withdraw U.S. troops have been slowed because military leaders argue that there is still a need for American counterterrorism forces as well as the ongoing campaign to train the Afghan troops.

Secretary of Defense Mark Esper speaks to reporters during a briefing at the Pentagon, Wednesday, Aug. 28, 2019. (Manuel Balce Ceneta/AP)

Dunford and Defense Secretary Mark Esper spoke at a joint news conference — the first time in exactly one year since a defense secretary and Joint Chiefs chairman have appeared together before Pentagon reporters.

Asked repeatedly about any U.S. plans to leave a counterterror force in Afghanistan, both Dunford and Esper batted the questions away.

"We reserve the right to keep all options on the table," Esper said when asked about continuing strikes on the Taliban. "But look, clearly we have a plan going forward. The key to resolve this conflict is a political agreement. We are on that path right now, and we are hopeful that we can reach some type of conclusion."

Dunford said that at some point the Afghans may be able to provide for their own defense without requiring direct U.S. military support.

"But we're not prepared to have a specific conversation about when that may be or what capability would be associated with what operating environment," he said.

Dunford, however, said that Trump has been clear that Afghanistan must not again be used as a sanctuary for terrorists who can attack America.

Al-Qaida insurgents used Afghanistan as a base from which to plan the Sept. 11, 2001, attack on the United States. A month later, U.S. troops invaded Afghanistan, where they have remained ever since, making it the longest war in American history. More than 2,400 American service members have died in the conflict.