U.S. soldiers with Task Force Iron at Bost Airfield, Afghanistan. (Sgt. Justin Updegraff/Operation Resolute Support via Associated Press)

PRESIDENT TRUMP’S resolution to delegate decisions on troop levels in Afghanistan to the Pentagon is a worthy corrective to the approach of President Barack Obama, who micromanaged U.S. military forces in a way that badly undercut their ability to achieve their goals. By politicizing force levels in Iraq and Afghanistan and setting timetables for withdrawal unlinked to conditions on the ground, Mr. Obama helped to ensure failure on his watch in both countries. The Islamic State gained control over much of Iraq, forcing the redeployment of U.S. troops, while a Taliban resurgence in Afghanistan now demands a similar reversal of previous withdrawals.

After what appeared to be a prolonged internal debate, Mr. Trump empowered Defense Secretary Jim Mattis to decide how many American troops will go back and what their specific objectives will be. Mr. Mattis, in turn, has promised to deliver a strategy to the White House next month, while taking interim measures to ensure that the military situation does not deteriorate further. As he told Congress this week, the Taliban is “surging”: By U.S. estimates, it controls or is contesting about 40 percent of Afghanistan’s territory.

A U.S. surge like that ordered by Mr. Obama in 2009, which sent tens of thousands of additional American troops to Afghanistan, is not in the cards. Instead, perhaps 3,000 to 5,000 additional U.S. personnel, supplemented by troops from NATO nations, will join the some 8,400 Americans and 5,000 Europeans currently in the country. The main aim will be to bolster Afghan forces so they can stop the Taliban’s momentum, including by increasing the size of elite Special Operations forces and backing them with air power — something the Obama administration senselessly restricted.

As senior U.S. officials in Kabul see it, the ultimate aim will be to make Afghan forces self-sustaining by 2020 and give the government leverage to negotiate a political settlement with the Taliban — if the extremist Islamist movement is willing to accept one. That will require, as Mr. Mattis hinted, a better regional approach that gains the cooperation of Pakistan, which continues to harbor, and probably to support, the Taliban faction that recently carried out a devastating bombing in Kabul.

Ultimately, success — or even the avoidance of disaster — will require years more of commitment by the United States, including more work on building Afghan political institutions. That effort must be led by the White House, not the Defense Department. While Mr. Trump is right to delegate decisions about troop levels, he cannot — as he has so far in his presidency — detach himself from a mission that continues to cost the country $3 billion a month. When Mr. Mattis’s strategy is ready, the president should make his own public commitment to it and explain to the country why it is necessary to continue a war that has already lasted nearly 16 years and cost more than 2,000 American lives.

Mr. Obama did his best to distance himself from the Afghan war, with the result that key political objectives in Afghanistan and Pakistan remained out of reach, while domestic support for the mission steadily declined. That’s another mistake that Mr. Trump has the opportunity to correct.