Credit: Evan Vucci | AP

WASHINGTON — President Donald Trump said Thursday the U.S. plans to withdraw more than 5,000 American troops from Afghanistan and then will determine further drawdowns in the longest war in American history.

Trump’s comment comes as a U.S. envoy is in his ninth round of talks with the Taliban to find a resolution to the nearly 18-year-old war. The president said the U.S. was “getting close” to making a deal, but that the outcome is uncertain.

“Who knows if it’s going to happen,” Trump told Fox News Radio’s “The Brian Kilmeade Show.”

Trump did not offer a timeline for withdrawing troops. The Pentagon has been developing plans to withdraw as many as half of the 14,000 U.S. troops still there, but the Taliban want all U.S. and NATO forces withdrawn.

“We’re going down to 8,600 (troops) and then we’ll make a determination from there,” Trump said Thursday, adding that the U.S. is going to have a “high intelligence” presence in Afghanistan going forward.

Trump has called Afghanistan — where the Taliban harbored members of the al-Qaida network responsible for 9/11 — the “Harvard University of terror.”

If terror groups ever attacked America from Afghanistan again, “we will come back with a force like they’ve never seen before,” Trump said. But he added: “I don’t see that happening.”

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.

The top U.S. military officer said Wednesday it’s too early to talk about a full American troop withdrawal from Afghanistan. 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.

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 also 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 root in the country and is 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 a country that it ruled before U.S. forces invaded in October 2001.

Secretary of State Mike Pompeo said Trump wants to end “endless wars” while ensuring the United States is protected, which means getting adequate guarantees that Afghan territory will never again be used as a launching pad for attacks on the United States or its allies.

“In a place like Afghanistan, that translates into ensuring that … we do everything we can to reduce the risk that terrorism will emanate from that space,” Pompeo said Thursday on Hugh Hewitt’s national radio show. “I am confident that we can do just that.”

Sen. Lindsey Graham, R-S.C., a key Trump supporter, and retired Gen. Jack Keane, a former Army vice chief of staff, urged caution.

“The United States cannot contract out the American people’s security to the Taliban who, in exchange for a U.S. withdrawal, simply ‘promise’ to guarantee that al-Qaida and ISIS (in Afghanistan) are denied haven,” they wrote in an op-ed Wednesday in The Washington Post.

Graham and Keane said they fear a U.S. withdrawal will not end the war and could start a new civil war as Afghan forces feel betrayed and abandoned and the Afghan government is severely undermined and weakened.

“The United States should never outsource its national security to anyone, especially the Taliban,” they cautioned. “We cannot rely on the Taliban for security; we have lost too many soldiers at Taliban hands for that. The Afghan war must end on our terms, not the Taliban’s.”

Moreover, they said U.S. national security interests require that any deal the United States signs with the Taliban should allow for a “meaningful U.S. counterterrorism capability, coupled with a robust intelligence apparatus” to deal with threats from terror groups.