A U.S. flag waves over a post in Deh Bala district, Nangahar province, Afghanistan. (James Mackenzie/Reuters)

U.S. military and Afghan officials grappled Friday with President Trump’s order to pull nearly half of all American troops from Afghanistan, a move that will probably focus the war on one of the few military efforts the president says he cares about: counterterrorism.

The order to draw up withdrawal plans, issued during a White House meeting this week, would reduce the military presence from more than 14,000 troops to about 7,000, drastically scaling back Pentagon efforts to assist and support Afghan forces.

Afghan forces have suffered hundreds of fatalities per month this year, as a resurgent Taliban puts pressure on the Afghan government despite a marginally expanded Pentagon mission there 16 months ago.

U.S. military officials in Afghanistan and at the Pentagon have declined to comment on the withdrawal plans. Some U.S. officials close to the president, speaking on the condition of anonymity because of the sensitivity of the issue, said they are trying to change the president’s mind.

Trump has long expressed frustration with the 17-year war and nation-building in general. In announcing his Afghan plan last year, he criticized efforts by the Obama administration as not muscular enough, but also said he was going against his own instincts to pull out of Afghanistan entirely.

Defense Secretary Jim Mattis, who resigned Thursday, and other senior U.S. advisers who lobbied for staying in Afghanistan are now on their way out. Other influential voices in foreign policy weighed in wearily, but focused mainly on the consequences of withdrawing all U.S. troops from Afghanistan, which would hamstring the Pentagon’s ability to carry out strikes against terrorist groups, including the Islamic State and al-Qaeda.

“An Afghan withdrawal would be even more calamitous than pulling out of Syria,” said James Stavridis, a retired Navy admiral, referring to Trump’s announcement this week that he would withdraw all American forces there. “It would lead to the resurgence of the Taliban, who would welcome al-Qaeda back with open arms.”

Stavridis made a case for keeping the existing strategy, adopted by Trump in August 2017, and said that not doing so undercuts U.S. efforts to strike a peace deal with the Taliban. Withdrawing 7,000 troops would be a “big mistake,” he said but acknowledged that it would focus the mission most heavily on strikes against terrorist groups.

In Afghanistan and at the Pentagon, military officials have privately discussed the possibility that Trump would run out of patience with the war. But many hoped they could at least make the case that the counterterrorism mission should continue.

Maintaining the mission will require the Pentagon to keep at least one major base open, most likely Bagram Airfield north of Kabul. The installation is home to a Special Operations task force from which Army Rangers and other elite forces launch raids, F-16 jets and other strike aircraft, and units that support them.

Since September, U.S. forces in Afghanistan have been commanded by Army Gen. Austin “Scott” Miller, a Special Operations veteran. He previously commanded Joint Special Operations Command, which oversees elite counterterrorism forces all over the world.

This year, the Pentagon has dropped more bombs in Afghanistan than at any time in the war, according to Air Force data. Last month, it acknowledged a raid in southern Afghanistan’s Helmand province against al-Qaeda forces in which an Army Ranger was killed by gunfire.

Less clear is the future of several major training efforts and the use of an Army unit known as a security forces adviser brigade, or SFAB. The first SFAB deployed to Afghanistan this year with backing from senior Army leaders and Mattis, and a similar unit was expected to deploy again in 2019.

Trump, speaking to The Washington Post in November, appeared to accept that terrorist groups remain and that he would have to deal with them.

“We’re there because virtually every expert that I have and speak to say if we don’t go there, they’re going to be fighting over here,” he said. “And I’ve heard it over and over again.”

In Afghanistan, aides to President Ashraf Ghani attempted to portray the news as no big deal, even as many observers expressed alarm.

Harun Chakhansuri, a top spokesman for Ghani, said on an Afghan TV news station that such a drawdown would have no major impact on Afghanistan’s ability to defend itself. He said most of the U.S. forces likely to be withdrawn “are engaged in a training and advising mission for Afghan forces, and Afghan forces are capable of defending the country.”

Several hours later, Fazl Fazili, another aide to Ghani, echoed that assessment, tweeting that the departure of a “few thousand” foreign military advisers would not affect Afghan security. In a second tweet, he said that since 2014, when most U.S. combat forces left the country, those who predicted a military collapse were proven wrong, and “our brave defense & security forces . . . defended the nation with great valor.”

The optimistic comments contrasted sharply with the alarmed reactions and dire predictions Friday of analysts, former officials and political figures in Afghanistan and neighboring Pakistan.

In both countries, a variety of observers said they feared that a sudden pullback of U.S. troops could usher in a period of political instability, give the Taliban insurgents extra power at the negotiating table or sabotage peace talks entirely, and leave Afghanistan more vulnerable to violence and terrorist attacks.

Many drew comparisons to the United States’ inattention to Afghanistan after the end of Soviet military occupation in 1989, which led to a government collapse in Kabul, a destructive civil war among ethnic militias and a huge exodus of refugees.

“A U.S. military drawdown will strengthen the Taliban’s position in the peace negotiations and precipitate political chaos in Kabul,” putting a constitutional transfer of power through elections in doubt, said Haroon Mir, a political analyst in the Afghan capital. Regional powers will again jockey for influence, but none will be able to “fill the political or economic vacuum left after a U.S. exit,” he said. “Ultimately, history will repeat itself.”

Constable reported from Islamabad, Pakistan. Josh Dawsey in Washington contributed to this report.