President Trump will soon have to decide what to do about Afghanistan. After weeks of wrangling inside his national security cabinet, top officials on Friday agreed on the broad outlines of a strategy to prosecute America’s longest war. The interventionists prevailed.

According to administration officials familiar with the deliberations of the cabinet’s principals committee, the Afghanistan strategy would tie the United States to the success of President Ashraf Ghani’s ambitious plan to build up an inclusive government and regain territory from the Taliban.

While the strategy envisions eventually forging a peace deal with the Taliban, in the meantime it would increase the pace of strikes — to encourage the Taliban to negotiate.

The new strategy, according to these officials, is not cheap. There would be a baseline of at least $23 billion a year to support a variety of initiatives in Afghanistan, not only subsidizing Afghan police and military forces but also funding anti-corruption programs and other priorities.

If that sounds expensive, bear in mind the untold costs if the United States instead failed to support Afghanistan’s recovery and the country became a safe haven for terrorists like it was before 9/11.

While no troop numbers have been set, US officials told me they would envision an increase in both US and NATO forces inside the country.

Most important, the strategy would jettison President Barack Obama’s approach of setting arbitrary deadlines for the withdrawal of US forces and instead would link the participation of US troops inside the country to meeting clear conditions on the battlefield, such as winning back territory from the Taliban and denying safe haven to al Qaeda, the Islamic State and other bad actors, according to these officials.

If all of this sounds familiar, it should. The Obama administration faced a similar choice in 2009. Back then the president chose to support a surge inside the country and a counterinsurgency approach.

And yet, Obama began to get cold feet about the strategy almost as soon as he approved it. Some voices in his administration, such as Vice President Joe Biden, favored a plan that focused on counterterrorism, striking terrorist leaders, but not rebuilding a discredited central government.

By the end of Obama’s presidency, he had blown through his own deadlines for withdrawing troops from the country as the Taliban and other terror groups grew stronger.

A similar dynamic has played out inside the Trump national security team. Throughout the deliberations, some officials raised concern that the plan would be throwing good money after bad, according to the US officials.

This worry is not without basis. The US special inspector general for Afghanistan reconstruction wrote in January that: “Afghanistan suffers from limited institutional capacity to conduct basic governmental functions, and from widespread and systemic corruption that consistently places it near the bottom of international rankings for public perception of corruption.”

Another fear raised at Friday’s meeting was that the strategy would be committing the US to a role in Afghanistan for the next several years. The view of the national security adviser, General H.R. McMaster, prevailed.

On Friday, none of those in the meeting objected to going forward with the more ambitious strategy. McMaster argued, according to these sources, that Trump should not make the same mistake Obama made by exiting Iraq too soon and allowing the Islamic State the room to regenerate and force another US intervention later.

A strategy paper reflecting the consensus of the meeting on Friday is now being worked over by regional experts at the policy coordination committee and is expected to be sent to the president’s desk as early as this week.

This will pose a particularly tough dilemma for the commander in chief.

On the one hand, Trump campaigned on the promise of defeating the Islamic State and other terrorist groups and trusting his generals to decide military strategy. In his first 100 days, Trump has largely kept his word on trusting military leaders and not micromanaging war planning from the White House as Obama did.

On the other hand, Trump also has repeatedly said the nation-building war in Iraq was a mistake. If Trump commits to Ghani’s success, he will be committing to the kind of globalism he disdained on the campaign trail.

Still, an American recommitment to Afghanistan now can avoid past mistakes. If there has been one lesson from recent US interventions, it is that premature exits are costly. Sooner or later, America gets drawn back into the wars it had hoped were over.

If Trump agrees, he will soon find himself rebuilding Afghanistan to keep America safe.

© 2017, Bloomberg View