WASHINGTON (Reuters) - President Donald Trump is planning to withdraw more than 5,000 of the 14,000 U.S. troops in Afghanistan, a U.S. official said on Thursday, in the latest sign Trump’s patience is thinning with America’s longest war and overseas military interventions.

On Wednesday, Trump rebuffed top advisers and decided to pull all U.S. troops out of Syria, a decision that contributed to U.S. Defense Secretary Jim Mattis abruptly quitting on Thursday over significant policy differences with the president.

One official, speaking on the condition of anonymity, said a decision had been made and verbal orders had been given to start planning for the drawdown. The official said timelines were being discussed but it could happen in weeks or months.

It is unclear how the United States with less than 9,000 forces in Afghanistan will be able to fulfill the full set of missions now underway, including training Afghan forces, advising them in the field, and waging an air campaign against the Taliban and other militant groups.

Instead, the United States almost certainly would have to curtail its missions, something that could provide an opportunity for a resurgent Taliban to expand their offensives across Afghanistan.

Mattis had argued for maintaining a strong U.S. military presence in Afghanistan to bolster diplomatic peace efforts. He resigned shortly after U.S. officials raised the possibility that Trump would order the drawdown.

The decision on Syria has bewildered U.S. allies and triggered harsh reaction from Trump’s fellow Republicans in Congress.

The Pentagon declined to comment on Afghanistan.

Garrett Marquis, a spokesman for the National Security Council, said the White House would not comment “on future strategic developments.”

FILE PHOTO: U.S. troops patrol at an Afghan National Army (ANA) Base in Logar province, Afghanistan August 7, 2018. REUTERS/Omar Sobhani

The United States went to war in Afghanistan in 2001 in the wake of the Sept. 11, 2001 attacks on the World Trade Center and the Pentagon, seeking to oust the Taliban militants harboring Saudi-raised militant Osama bin Laden, who led plans to carry out the attacks.

U.S. officials are currently engaged in talks with the Taliban, who now control a significant amount of territory. The Taliban insurgency has strengthened its grip over the past three years, with the government in Kabul controlling just 56 percent of Afghanistan, down from 72 percent in 2015, a U.S. government report showed.

Trump privately has been grousing about U.S. military involvement in Afghanistan, telling an ally as recently as Wednesday words to the effect of, “What are we doing there? We’ve been there all these years.”

The source, who asked to remain unidentified, said it appeared the president “has lost all patience” with the U.S. military presence in Afghanistan.

More than 2,400 U.S. forces have died in the 17-year-old war in Afghanistan, and Pentagon officials have repeatedly warned that a precipitous exit would allow militants to develop new plots on America.

Republican Senator Lindsey Graham, often a vocal Trump ally, warned of possible danger to the United States if the drawdown goes through.

“The conditions in Afghanistan - at the present moment - make American troop withdrawals a high risk strategy. If we continue on our present course we are setting in motion the loss of all our gains and paving the way toward a second 9/11,” Graham said in a statement.

Trump last year approved an increase in U.S. troops but acknowledged that he did so reluctantly.

Late last month, at least 22 Afghan police were killed in a Taliban ambush in Afghanistan’s western province of Farah, adding to the growing casualty toll on Afghan security forces.

Earlier this week, U.S. special envoy Zalmay Khalilzad and Taliban representatives held talks in Abu Dhabi on a deal that would end the war. Officials from Saudi Arabia and the United Arab Emirates also took part.

The Saudi ambassador to Washington, Khalid bin Salman, tweeted on Thursday that the discussions had been productive and would bring “very positive results by the beginning of next year.”

But a former senior State Department official familiar with the issue said that the Taliban representatives rejected a proposal by Khalilzad for a ceasefire and demanded that the talks focus on a U.S. withdrawal.

(The story is refiled to fix typo in fifth paragraph.)