Five years ago, before he was a candidate for president, Donald Trump was pretty sure he knew what to do about Afghanistan. It was a losing proposition, "a complete waste" in terms of "blood and treasure."

"Why are we continuing to train these Afghanis who then shoot our soldiers in the back?" he asked on Twitter in 2012. "Afghanistan is a complete waste. Time to come home!"

More recently, candidate Trump was less certain about exactly when the U.S. should exit the struggle that he had railed against continuing.

And by Monday night, addressing the nation as commander in chief, President Trump had a different view. His first instinct had been to pull out, he said. But now, he understood how different things looked when you "sit behind that big desk in the Oval Office."

And why? Because, he explained, now he knew he had to deal with consequences. And that meant we would be staying in Afghanistan.

How long? There would be no more timetables or dates on calendars, he said.

With how many troops? He wasn't saying. Too much information of that sort had been given away in the past, he said.

(U.S. officials tell NPR the short-range surge is now planned at about 4,000 troops, increasing the current deployment by about half).

So how would we know when we were winning, or had won? Or that it was time to leave? That would be based on conditions, the president said. We would base our assessment on concrete improvements in conditions. There would need to be programs and progress on reforms; we were not giving anyone "a blank check."

And we will not "use American military might to construct democracies in faraway lands or try to rebuild other countries in our own image" — a reference to the so-called "nation building" efforts of previous administrations.

A deliberate decision

It was a strong performance of a carefully crafted and even eloquent speech. Trump strove as he rarely has to personify presidential deliberation and the careful weighing of concerns. He wanted the nation to know he had thought about this.

Indeed, for several months, Trump has been frustrated with the state of the mission in Afghanistan, where "we are not winning." He has toyed with relieving the commander in the field and fumed at the fecklessness of supposed allies in the region. He has again threatened withdrawal.

Earlier in the summer, he tried to grant Defense Secretary James Mattis the authority to raise the troop level if Mattis wanted. But the secretary said no, he would not send more troops until there was a commitment to a strategy from the top.

Then, at a special briefing at Camp David on Aug. 18, national security adviser H.R. McMaster gave his boss three options. One was to withdraw, a second to escalate and expand the conflict aggressively. The third was a middle ground, sending more troops to do more training and assisting, more strengthening of the Afghani forces, but under a broad set of restated goals.

"How long have we been in Korea?"

Though less dramatic, the third option also seemed less likely to court disaster — at least in the near term.

Trump would refer to the restated goals on Monday night as a new "principled realism" that was built on several "pillars." These included forsaking any timetables or telegraphing of our plans or tactics. Instead, Trump said, the U.S. would target certain changes in conditions, although these were not specified.

They also included a new resolve to "confront Pakistan" over its ambivalence toward the Islamic extremists while also partnering with India. There was also a renewed vow to empower commanders in the field to fight and win with all the weapons and tools for "front line soldiers acting in real time to defeat the enemy."

It was apparent that the president's preference for boldness was not quite satisfied with this. But the consequences of either withdrawal or escalation were, as the president described them Monday night, unacceptable.

Without the U.S. presence in Afghanistan, Trump argued, al-Qaida and ISIS and the Taliban and other Islamic militants would use that country to stage attacks on the West — specifically the U.S. — as happened prior to the terror attacks of Sept. 11, 2001.

It served to remind everyone of how long we have been in Afghanistan. The president called it America's longest war, but explicitly rejected the idea of an endpoint. When NPR's Tom Bowman asked one Pentagon official on Monday how long this recommitment to Afghanistan might last, the official asked, "How long have we been in Korea?" (Answer: since 1950.)

Addressing distress and disunity

There were other undertones to the president's address, which began with a paean to the "brothers and sisters" in uniform, the "special class of heroes" who embody, he said, the unity of purpose that makes America great.

He was speaking to a hall full of soldiers at Fort Myer, an Army base just a few miles from the White House across the Potomac River into Virginia. But he was also addressing the distress and disunity that followed recent violence in Charlottesville, not too far to the south in the same state.

"The soldier understands what we as a nation too often forget," the president said. "A wound on one is a wound on all, and when one citizen suffers we all suffer."

With those sentiments the president sought to soften the tone and effects of his own public appearances and utterances over the past 10 days.

It was an appropriate choice, before the right audience. Because the president was making his first appearance in the role of a commander in chief who was about to commit fresh U.S. forces to combat overseas.

His admonition was one the assembled men and women in uniform had heard before, a call to duty and an appeal to honor. They will surely respond as he knows they will.

Copyright 2017 NPR. To see more, visit http://www.npr.org/.