President Donald Trump has just unveiled his plan for turning around the 16-year war in Afghanistan that he and others in his administration admit the US is losing. And it turns out his new strategy looks a lot like President Barack Obama’s old one.

Obama had sent tens of thousands more American troops to Afghanistan in the hopes of hammering the Taliban hard enough that the militants would be open to negotiating a peace agreement. He also pressured Pakistan to help the US in the fight by cracking down on the terrorist safe havens inside its lawless border regions and doing more to prevent weapons and fighters from flowing into Afghanistan.

Trump seems to be generally following the Obama blueprint, with one major exception. When Obama ordered reinforcements to Afghanistan in 2009, he said they’d start to be withdrawn within 18 months — a fixed deadline that infuriated critics from both parties. Trump, by contrast, repeatedly stressed in his Monday night address that there was no timetable for how long American troops would remain in Afghanistan. That effectively means the longest war in American history will extend into the indefinite future.

“Conditions on the ground, not arbitrary timetables, will guide our strategy from now on,” Trump said in a speech heavy on harsh rhetoric but strikingly light on details.

Trump didn’t say how many more American troops, if any, would be sent to join the 8,400 already in Afghanistan. That was on purpose: The president said he wanted to keep the enemy guessing (some reports say he may send about 4,000 troops).

Throughout his speech, Trump stressed that the US was in Afghanistan for counterterrorism, not nation-building, and that Washington didn’t care whether or not the country remained a democracy. That’s very much in keeping with Trump’s broader embrace of foreign autocrats ranging from Turkish President Recep Tayyip Erdoğan to Egyptian strongman Abdel Fattah el-Sisi.

Like Obama, Trump said Pakistan had to do more to help the US win in Afghanistan and blasted the country for sheltering terrorists. But Trump seemed to go further than his predecessor when he noted that the "billions and billions" the US pays to Pakistan may some day dry up.

Should he actually cut aid to Pakistan, and label it a state sponsor of terrorism if it continues to harbor terrorists, as some reports indicated he might, Trump will have punished Pakistan more than Obama did. That said, it’s worth noting that Obama witheld $300 million of military support to Pakistan last August.

“We have been paying Pakistan billions and billions of dollars, at the same time they are housing the same terrorists that we are fighting. But that will have to change. And that will change immediately,” Trump said.

Trump’s speech was many months in the making, with top administration officials repeatedly trying, and failing, to get Trump to make a decision about the way forward in Afghanistan. The president — backed by advisers like former chief strategist Steve Bannon — was skeptical about spending more blood and treasure when the Taliban controls more than 40 percent of Afghanistan and is continuing to gain ground.

In the end, though, President Trump abandoned candidate Trump’s skepticism about Afghanistan and agreed to continue a war he’d long belittled. Trump announced the decision at Fort Myer, the military installation near Arlington Cemetery where some of the 2,258 US troops who died in Afghanistan were laid to rest. It was couched as part of a new and comprehensive strategy for stabilizing both Afghanistan and Pakistan.

“We will win,” Trump declared Monday night.

His predecessors had said the same thing, and were proven wrong. Now it’s Trump’s turn.

Trump has long been skeptical of the war in Afghanistan. He just chose to keep it going.

“What are we doing there? These people hate us,” Trump said in a 2012 Fox News appearance, as reported by my colleague Zack Beauchamp. “We’re spending hundreds of billions of dollars, trillions of dollars, on this nonsense — and the minute we leave, everything blows up, and the worst guy gets it. The one who hates this country the most will end up taking over Afghanistan.”

But after winning the election, Trump called Afghan President Ashraf Ghani in December and told him he would consider sending more troops to Afghanistan, the Wall Street Journal reported. After the conversation, an unnamed Afghan official stated that Trump “would certainly continue to support Afghanistan security forces and will consider a proposal for more troops after an assessment.”

In office, Trump has more vocally asked why the US was doing so poorly in Afghanistan despite spending around $714 billion there over the past 15 years and losing a total of 2,264 troops and civilians.

"We aren't winning," he said in a July 19 meeting with his advisers. "We are losing."

He even threatened to replace Gen. John Nicholson, the top commander in Afghanistan, who warned Congress in February that the conflict was at a “stalemate” and could only be broken by putting thousands more US troops in the region.

But the US intelligence community was less confident that America could soon improve conditions in Afghanistan, even if more troops were sent in.

"The intelligence community assesses that the political and security situation in Afghanistan will almost certainly deteriorate through 2018, even with a modest increase in military assistance by the United States and its partners," Dan Coats, the director of national intelligence, said to the Senate Intelligence Committee on May 11.

Months of infighting split Trumpworld as it tried to agree on a strategy to deal with an Afghanistan in crisis.

On one side, Vice President Mike Pence and National Security Adviser H.R. McMaster advocated sending in more troops to advise and train Afghans to fight the Taliban over the next four years. On the other side, Bannon argued against sending in additional US forces but was open to a proposal by private contractor Erik Prince to replace troops with mercenaries.

Prince, the former head the infamous private security firm Blackwater, also proposed installing an American “viceroy” to run the country and oversee the mercenaries.

Defense Secretary Jim Mattis didn’t like the proposal and tried to shut it down. McMaster even blocked Prince from attending a meeting last Friday on Afghanistan at Camp David, the presidential retreat, where Trump said he had made his decision.

Other plans were also put in front of Trump, including a gradual troop withdrawal and an ongoing counterterrorism-focused mission with fewer troops than there are now. Trump, however, didn’t like those options. He didn’t think they would stop the country from being overrun by terrorists, and he didn’t want to be remembered for letting that happen on his watch, Axios reports.

Despite multiple meetings, Trump continually sent proposals back to his national security team for more work. One meeting in July was described to Politico as a “shitshow” where heated “words were exchanged.” Over time, officials grew frustrated with one another. At one point, Bannon’s camp labeled Afghanistan as “McMaster’s War” because of his push to send troops.

There was even a coordinated right-wing online attack on McMaster to discredit him as Afghanistan deliberations continued. The lead story Monday night on Breitbart, the right-wing website Bannon took over for the second time after being fired by Trump late last week, said Trump’s speech was a “flip-flop” because it seemed to involve sending more troops.

At some of the meetings, Trump openly lamented that NATO allies — many of which have been fighting in the war since its start — weren’t doing their fair share to help. The administration has signaled that NATO and the US must increase their troop totals in Afghanistan at the same rate.

All the deliberation led Trump to blow by two deadlines for unveiling the new strategy. He’d been expected to release the plan before a NATO summit on May 25, but he instead used the occasion to bash allies for not spending enough on defense. Then Mattis told the Senate Armed Services Committee on June 13 that a strategy would be completed by mid-July — but it didn’t materialize.

Afghanistan is full of problems, including a more powerful Taliban and a corrupt government. The solutions have evaded the past two White Houses. Even the Obama administration had trouble achieving a victory despite overseeing 100,000 troops in 2011, the highest level to date.

Some believe a military-focused solution won’t be enough to tackle Afghanistan’s issues. “We keep putting Band-Aids on, we keep giving the patient aspirin, but we never do enough to solve the core causes,” David Sedney, a former top Pentagon official focusing on Afghanistan and Pakistan, said in an interview. He added that more troops “won’t be enough to stop the bleeding and save the patient.”

Afghanistan won’t be easy to solve, even with a new plan

There are two main issues facing Afghanistan: the growing strength of the Taliban and other terrorist groups and Pakistan’s role in failing to curb the crisis.

According to a recent Pentagon report, there are about 20 terrorist groups operating in the Afghanistan and Pakistan region, including the Taliban, an ISIS offshoot, and al-Qaeda. The US and its allies have been training, advising, and assisting Afghan troops to push back on those militants since Afghanistan took the lead in fighting them three years ago.

The New York Times reports that Afghanistan has about 21,000 special operations forces that perform about 70 to 80 percent of the country’s fighting, even though they make up only about 7 percent of the country’s forces.

The good news is the Taliban has not overtaken any provincial capitals or important cities this year, but there is still a lot of violence in the country. The Pentagon notes that from December 1, 2016, to May 31, 2017, enemies attacked 4,806 times.

In the same time period, there were more than 3,600 civilian casualties, about a third of them fatal. The total is about a 33 percent increase compared with the same time frame a year earlier, the Defense Department reported. Getting the Taliban to sit down for some sort of negotiation will be a tough task because of the gains they’ve made.

It’s also not a new idea. In fact, it was the same thinking the Obama administration used to determine its own strategy for the war. And as much as Trump doesn’t like to be compared to Obama, it might be hard for him to escape the parallels when it comes to Afghanistan.

On December 2, 2009 — after a year of intense deliberation and review — Obama announced he was sending 30,000 more US troops into Afghanistan, even though he also announced troops would start to come home 18 months later. Critics inside and outside the military blasted the decision because they said it signaled to the Taliban that they simply had to wait Obama out. That may be part of the reason why Trump chose not to announce a timeline.

“We are there to make sure that we don’t have another 9/11 originate in Afghanistan,” Andrew Wilder, an Afghanistan expert at the US Institute of Peace, told me. He was referring to how al-Qaeda was able to plan the attacks in Afghanistan’s ungoverned places. That’s why he feels it is important to commit US troops to the region: to ensure al-Qaeda or other groups don’t have the time and space to plan that kind of strike again. Trump alluded to 9/11 a few times in his speech, citing the same concerns.

And then there’s Pakistan. Over the years, it has been a strange bedfellow for the US, helping America with counterterrorism missions while serving as a safe haven for terrorists. In his speech, Trump is expected to put more pressure on Pakistan to help stop the crisis there.

Sedney said Pakistan doesn’t have much of an incentive to help stabilize Afghanistan because of its fears that other countries — especially India, its historical nemesis — may use Afghanistan as a base to attack it in the future. A destabilized Afghanistan with terrorists in control of key areas makes it an unsafe place for other countries to station their troops.

That means Trump’s new strategy has to contend with a growing terrorism problem and an ally that has at best a mixed record of helping the US stop the fighting in Afghanistan. Devising the plan was hard for the White House. Making it work will be even harder.

Correction: The Pentagon says 2,264 Americans have died in Afghanistan since 2001. An earlier version of this article incorrectly said the death toll was closer to 1,800.