ANALYSIS: In reversing position on Afghanistan, Trump gives himself an out Trump said it was part of an emerging doctrine formed with Cabinet and generals.

 -- It was as close as President Trump ever really gets to admitting he was wrong.

His instinct, he told the American people last night, was to pull out of Afghanistan — in keeping with his position for many years as a private citizen and a candidate. It was only after intense meetings and behind-the-scenes wrangling with his "Cabinet and generals," he said, that he landed on a strategy that recommits American forces to the nation's longest-running war.

"Our nation must seek an honorable and enduring outcome worthy of the tremendous sacrifices that have been made, especially the sacrifices of lives," Trump said.

But even in that context, he is leaving himself room to reverse again. By making clear that he's going against his "original instinct," he's left the door open to blame others if this new strategy doesn't meet its goals.

The plan itself is so vague — perhaps, if you believe the White House's take, intentionally so — that it may be impossible to judge its effectiveness. A war that has frustrated presidents, generals and tacticians for 16 years seems destined to linger, and Trump is already trying to limit his culpability for setbacks.

"When I became president, I was given a bad and very complex hand," he said.

In the immediate term, Trump managed to rally the Republican establishment back to his side. After a dismal week of denunciations and a debate over the nature of white supremacists, Trump found himself back in a comfort zone of praise from the party's hawks.

At the same time, by going back on his explicit word about ending American involvement in Afghanistan, he's picking a fight with a segment of his base that may have a louder voice, now that Steve Bannon is out as White House counselor.

"Donald Trump echoes Obama 'blank check' rhetoric," read one headline on Bannon's Breitbart News website.

"I think it is a terrible idea to send any more troops into that war," said Sen. Rand Paul, R-Ky.

Trump cast his decision as part of his emerging doctrine.

"Principled realism will guide our decisions moving forward," he said, reusing a phrase he debuted during his Middle East trip.

His approach includes a challenge to Pakistan, a troublesome sometime ally, in addition to more resources aimed at fighting terrorism in Afghanistan. But the strategy, as outlined, has so few details attached that Trump will have leeway in defining success — at least to a point.

He has demonstrated a mastery of understanding and motivating his base, as evidenced by the fact that 28 percent of Americans approved of his response to the recent violence in Charlottesville, Virginia, according to a new ABC News/Washington Post poll.

And he seemed to have far more than Afghanistan on his mind last night, in a speech that seemed more about Virginia than about South Asia at times.

"We cannot remain a force for peace in the world if we are not at peace with each other," Trump said. "As we send our bravest to defeat our enemies overseas — and we will always win — let us find the courage to heal our divisions within."

For a political newcomer, Trump has appeared to find comfort in the tangle of politics. He even has a re-election rally scheduled for tonight in Arizona, though the mix of local personalities and issues, combined with national tensions, could be explosive.

It's not clear how committed Trump is to either a new tone or a new national security strategy. But tellingly, even when he backs off a previously held position, gives himself an out.