Obama Hopes for "Limited Military Presence" in Afghanistan by Year's End

President Obama arrived in Afghanistan on Sunday for an unannounced visit, in which he commended U.S. troops for the sacrifices they have made and said he was hopeful that a bilateral agreement signed by the end of the year would allow for “limited” troops in the country.

“Of all the honors that I have as serving as president, nothing matches serving as your commander-in-chief,” Obama told troops in Bagram.

Obama thanked the soldiers for progress in Afghanistan, including the recent Afghan election, more local girls in school and Afghans reclaiming their communities.

“Al Qaeda is on its heels in this part of the world and that’s because of you,” Obama said.

The surprise trip came as the U.S. and NATO are withdrawing most of their forces ahead of a year-end deadline. Obama is seeking to keep a small number of U.S. troops in Afghanistan beyond 2014 to train Afghan security forces and conduct counterterrorism missions.

But that plan is contingent on with Afghan President Hamid Karzai’s successor signing a bilateral security agreement, which Karzai himself has refused to authorize.

“For many of you, this will be your last tour in Afghanistan,” Obama told the troops, crediting them with the lead Afghan forces have taken to secure the country.

Obama said he hopes a bilateral security agreement would be signed by year’s end, and at that point, “America’s war in Afghanistan will come to a responsible end.”

Beyond 2014, Obama said there would be a “limited military presence” in Afghanistan in order to “make sure that Afghanistan can never again ever be used to launch an attack against our country” and insure Afghanistan doesn’t regress.

The President landed at Bagram Air Field at about 8:15 p.m. local time (11:45 a.m. ET).

Air Force One had secretly left Washington from Andrews Air Force Base under cover of darkness at about 10:30 p.m. Saturday night.

This is the fourth trip of Obama's presidency and the first since May 2012, when he visited the Presidential Palace and made an address to the nation.

Others traveling with the president included National Security Adviser Susan Rice, plus advisers Dan Pfeiffer, Ben Rhodes and John Podesta, whose son is currently serving in Afghanistan. Country music star Brad Paisley also joined the group, and will perform for troops during the visit.

A pool of White House reporters and photographers accompanied the president under the strict condition that they not report on the trip until authorized, due to security considerations.

It initially was unclear if Obama would meet with Karzai, but the Afghan president issued a statement saying that he was asked to meet Obama at Bagram Air Base, but he turned down the offer and said he was ready to host him at the palace instead.

He did promise to shake the hand of every single service member on the base following his remarks. “I might not be able to take a selfie with everybody but I’ll shake every hand,” the president said.

At least 2,181 members of the U.S. military have died during the nearly 13-year Afghan war and thousands more have been wounded.

There are still about 32,800 U.S. troops in Afghanistan, down from a high of 100,000 in mid-2010, when as Obama sent in additional soldiers to quell escalating violence.

Obama spent just a few hours on the base before getting back on Air Force One and flying to Europe to refuel before heading back across the Atlantic.