Family members of an Afghan local police official who was reportedly killed during an operation against Islamic State militants sit beside his grave. (Ghulamullah Habibi/European Pressphoto Agency)

ONE OF the most curious aspects of President Trump’s foreign policy has been his absence of a clearly articulated view — much less a strategy — on Afghanistan, where 8,400 U.S. troops are still helping fight a war. Before and during his campaign, Mr. Trump hardly spoke about what has become the United States’ longest conflict, except to denounce Pakistan for its role in supporting the Taliban and to deride U.S. attempts at nation-building in one of the world’s least developed countries. This month, the president authorized the dropping of the world’s biggest nonnuclear bomb in a remote part of eastern Afghanistan even though he had yet to decide whether and how the United States would remain engaged in the country.

Now the administration appears to be moving toward filling this glaring gap. Defense Secretary Jim Mattis visited Kabul this week, following a trip by national security adviser H.R. McMaster; a policy review is said to be near completion. A recommendation is pending from the U.S. commander in the theater, Gen. John W. Nicholson, to send 3,000 or more additional U.S. troops to the country in an attempt to break the momentum of the Taliban, which has been slowly taking ground from the Afghan government and inflicting unsustainable casualties on its security forces.

Mr. Trump should approve the increase along with other military measures that could turn the tide. But he should also drop his resistance to U.S. programs to bolster the Afghan economy and political system and to fight corruption. Without them, the war will never be won.

The military problems plaguing the government of President Ashraf Ghani were tragically exemplified last week when a Taliban attack on an army base killed more than 160 soldiers — many of them raw recruits. The skillful operation by militants disguised as soldiers was attributed by some U.S. officials to the Haqqani network, which continues to find safe harbor in Pakistan. Meanwhile, administration officials say Russia and Iran have begun supplying weapons to other Taliban factions in a clear attempt to undermine the U.S. and NATO forces backing the Ghani government.

At least 6,700 of the more than 300,000 Afghan security forces were reportedly killed last year as the Taliban gained territory across the country. That was partly because many Afghan units remain poorly trained, but also because they lack adequate air support in battle, due to tight restrictions on U.S. operations imposed by President Barack Obama. Mr. Trump should address both problems by dispatching additional U.S. trainers and Special Operations forces and by allowing American planes and drones to operate with the same freedom against the enemy that they have in Iraq and Syria.

At the same time, Mr. Trump should back a parallel effort to bolster Mr. Ghani’s government, which has been hamstrung by political infighting and continued corruption. Reading inspectors general’s reports about how billions in U.S. and other international development aid have been squandered, it is easy to jump to the conclusion that the West should abandon Afghan nation-building. Yet progress has been made — the country’s gross domestic product has doubled , and education levels, including for women, have risen sharply. Sustaining that development, even if it is slow and painful, is as important as turning back the Taliban.