WASHINGTON – The Trump administration's envoy to Afghanistan said Monday that the United States had reached a preliminary peace deal with the Taliban that will pave the way for a phased withdrawal of U.S. military forces from Afghanistan and bring an end to America's longest war.

U.S. negotiators have agreed to remove approximately 5,000 American troops from five bases over the next five months if the Taliban fulfills promises to reduce violence and prevent Afghanistan from becoming a haven for terrorists, the U.S. special envoy, Zalmay Kalilzad, told the local news channel TOLO .

The deal – the fruit of months of negotiations between Trump administration officials and Taliban leaders – could allow Trump to declare victory on a core campaign promise as he enters the 2020 reelection cycle. The president has repeatedly said the U.S. should not be engaged in expensive "endless wars."

"We have reached an agreement with the Taliban in principle but of course until the U.S. president agrees with it, it isn't final," Khalilzad said in an interview with TOLO News.

The White House and the State Department did not immediately respond to a request for comment.

In a series of Twitter messages, Khalilzad said he concluded negotiations with the Taliban over the weekend and then traveled to Kabul to brief Afghan leaders.

An aide to Afghanistan's President Ashraf Ghani said officials were reviewing the deal and talks were ongoing.

"President Ghani ... met with Amb Khalilzad today," Waheed Omer, Afghanistan's director general for public and strategic affairs, said in a tweet. "We will look into the document and discussions with Amb Khalilzad and team will continue."

The move to reduce America's military presence in Afghanistan is fraught with political and military peril. Critics – including some of Trump's strongest supporters – fear a U.S. withdrawal will open the door for a resurgence of al-Qaida, as well as other terrorist groups operating in Afghanistan, such as the Islamic State.

"There will be another 9/11 if we pull the plug," Sen. Lindsey Graham, R-S.C., said in an Aug. 27 interview on Fox News.

"Al-Qaida is alive and well in Afghanistan. ISIS is stronger today than they've ever been in Afghanistan," Graham said. "There is no substitute for American forces in Afghanistan to protect the American homeland from radical Islam."

He and others argue that the Taliban, itself is a militant fundamentalist group, cannot be trusted to keep Afghanistan free of terrorists.

"Trump is repeating now the mistakes of Obama: appearing to reestablish artificial deadlines rather than matching conditions," said James Cunningham, who served as the U.S. ambassador to Afghanistan in President Barack Obama's administration.

While Cunningham has not seen the details of the deal, he said the emerging outline is worrisome and suggests Trump is "not using all efforts to get a genuine peace negotiation," which would require more time than the Trump administration has invested.

Congress:Senate advances bill warning against 'precipitous withdrawal'

Hasty pullout?Trump clears path for more U.S. troops

Military leaders have resisted Trump's push for a full, speedy withdrawal. When asked about the potential peace deal last week, Marine Gen. Joe Dunford, chairman of the Joint Chiefs of Staff, told reporters that he’s “not using the withdrawal word.” There are about 22,000 coalition troops in Afghanistan now, 14,000 of them Americans.

Dunford stressed that an agreement with the Taliban would be “conditions based,” a term favored by commanders who oppose deadlines for the drawdown of troops.

The draft peace agreement also leaves major questions unresolved, most notably what role the Afghan government, which is backed by the U.S., will play in the future of the country. The Taliban has so far refused to negotiate with Ghani, demanding the complete withdrawal of all foreign military forces first.

It's not clear if those two parties could come to any power-sharing agreement. The Taliban already controls a large swath of the country, and the Afghan government remains heavily dependent on the U.S. military for its security, according to a recent analysis by Robert Pape, director of the Chicago Project on Security and Threats.

Pape said a complete U.S. withdraw from Afghanistan could throw the country into chaos. But he also said maintaining the status quo is a recipe for "catastrophic failure."

He noted that the Taliban already control nearly half the country, and they're making territorial gains by the day.

"We’re in a losing game and have been for 15 years," Pape said. And America's ongoing presence in Afghanistan is "galvanizing the country" against the U.S.

He said the U.S. must craft a new strategy that includes special combat operations, intelligence gathering and keeping U.S. troops stationed in the region, ready to return if the Taliban renege on their promises.

Trump administration officials say this peace deal is the only realistic path forward after so much blood and treasure lost.

"Our 18 years of military, diplomatic, and economic engagement there has helped transform Afghan society, and we crushed al-Qaida," Secretary of State Mike Pompeo said last week in a speech to the American Legion. "The truth is America has never sought permanent military presence in Afghanistan, and all sides recognize that times move on."

To be sure, the American public and lawmakers in both parties have grown increasingly weary of the conflict.

It has been nearly 18 years since the U.S. military opened a devastating bombing campaign against the Taliban forces, who were then providing sanctuary to Osama bin Laden. The war has claimed the lives of more than 2,400 American service members – and at least 38,000 Afghan civilians; it has also cost U.S. taxpayers $975 billion, according to an estimate by researchers at Brown University.

Those high costs have not paid off, Americans say. In an October 2018 poll, conducted by the nonpartisan Pew Research Center, 49% of respondents said the U.S. had "mostly failed" in achieving its goals in Afghanistan.

Trump questioned U.S. involvement in Afghanistan for years, at least as far back as August 2011, when he took to Twitter to argue Washington was “wasting trillions of dollars” in Iraq and Afghanistan. He described the war a “total disaster” in 2012 and called for a “speedy withdrawal” in 2013.

The president was more circumspect during his campaign, rarely tweeting about the conflict. During the 2016 presidential debates between Trump and Democrat Hillary Clinton, the war was barely mentioned. In 2015, Trump told CNN that the U.S. made a “terrible mistake” engaging in Afghanistan but said a sudden withdrawal would bring about a “collapse in about two seconds after they leave."

Trump acknowledged his shifting position during an address two years ago at Fort Myer, Virginia, in which he announced the U.S. would send additional troops to Afghanistan rather than pursuing a withdrawal. The remarks were among the most extensive he has made on the conflict.

"My original instinct was to pull out, and historically I like following my instincts, but all my life I've heard that decisions are much different when you sit behind the desk in the Oval Office," Trump said at the time.

Contributing: The Associated Press