President Barack Obama is fond of saying the war in Afghanistan will "end" this year, but he still plans to keep troops in the country indefinitely.

During his surprise four-hour visit to Afghanistan this weekend — under cover of darkness and with no prior notice and no visit with outgoing President Hamid Karzai — Obama suggested he'd still like to keep troops in that country.

"I’ve made it clear that we’re prepared to continue cooperating with our Afghan partners on two security missions — training and equipping Afghan forces and targeting ... al Qaeda," Obama told the troops. "Once Afghanistan has sworn in its new president, I’m hopeful we’ll sign a bilateral security agreement that lets us move forward. And with that bilateral security agreement, assuming it is signed, we can plan for a limited military presence in Afghanistan beyond 2014. Because after all the sacrifices we’ve made, we want to preserve the gains that you have helped to win. And we’re going to make sure that Afghanistan can never again, ever, be used again to launch an attack against our country." Separately, Obama noted that he has to "make some decisions" about post-2014.

But he sounds like his mind has been made up — except, perhaps, for just how many troops to keep.

"We’ll probably be announcing some decisions fairly shortly," he said. "But it’s important for me to make sure that I check in directly with folks face-to-face before those decisions were finally made."

Obama's comments were backed up by an administration official in a background briefing, although the official reiterated that if Afghanistan does not sign the agreement, no troops would remain. And the administration made sure reporters knew that both contending presidential candidates in Afghanistan plan to sign a security agreement with the United States — something Karzai has refused to do.

That makes a follow-on force all but a fait accompli barring a change of heart by the new president. And it will mean a different result than in Iraq, where a decision by that country's leadership not to sign a security agreement led to a pullout of U.S. military forces.

Keeping troops in Afghanistan will mean at some point that Obama will have to come to Congress at least for funding. That's not likely to be be particularly difficult, although in recent weeks some lawmakers have called for revisiting the broad use of force authorization that followed the Sept. 11, 2001 attacks.