President Obama landed at Bagram Airfield in Afghanistan on Sunday and was gone four hours later after making a secret trip to the country.
"For many of you, this will be your last tour in Afghanistan," he told nearly 3,000 troops.
His surprise trip on Memorial Day weekend came as the president and the Department of Veterans Affairs face criticism of long wait times and mismanagement in the VA that could have led to deaths at some clinics in the United States.
Deputy National Security Adviser Ben Rhodes said the White House wanted to make the trip about the troops and not Afghanistan politics. Rhodes said the VA scandal was not a “factor into the planning for the trip.”
On the trip, Obama received a briefing from top commanders in Afghanistan and visited wounded military personnel at a base hospital.
The trip marks Obama's fourth to the country and the first in his second term. More than 32,000 U.S. troops remain in the country and most are expected to return home later this year.
"We want to preserve the gains that you have helped to win,” he said in his speech. “And we are going to make sure that Afghanistan can never again, ever be used again to launch an attack against our country."
Obama called Afghan President Hamid Karzai before leaving Bagram, according to a White House pool report that quoted an administration official who said Obama praised Karzai for the progress being made by the Afghan security forces and for the successful first round of the presidential elections.
Obama also expressed support for an Afghan-led reconciliation process with the Taliban, the official said.
The United States has sought a bilateral security agreement with Afghanistan to allow a small number of U.S. forces to remain in the country to help train Afghan forces and other counterterrorism efforts. But after a number of failed attempts to get an agreement with Karzai, Obama expressed hope Sunday of an agreement with Karzai's successor after the runoff elections in Afghanistan later this year.
The president will provide more specifics on his thinking on Afghanistan with a speech at West Point on Wednesday. During a briefing ahead of his speech, Obama said the administration was likely to announce a decision on future troop levels "fairly shortly."
In the U.S., Obama is facing criticism about healthcare for those veterans returning home. However, he did not specifically mention it in his speech.
Caring for wounded veterans, Obama said, is "not just a promise. It is a sacred obligation."
Reports last month suggested nearly 40 veterans died while on a secret wait list at a Phoenix VA clinic, though it is not clear if the deaths were a result of the long wait time. Since then, allegations of similar mismanagement have surfaced around the country and the inspector general is investigating 26 facilities.
The administration announced Saturday that it would allow more veterans to get care through private facilities.
"We ended the war in Iraq. And as our war in Afghanistan ends and as our newest veterans are coming home, the demands on the VA are going to grow," Obama said during a press conference last week addressing the allegations. "So we're going to have to redouble our efforts to get it right as a nation. And we have to be honest that there are and will continue to be areas where we've got to do a lot better."
Country music singer Brad Paisley traveled with Obama to Afghanistan and gave a performance for the troops ahead of Obama's speech.
Also along on the trip are National Security Adviser Susan Rice, senior director for Afghanistan and Pakistan Jeff Egger, senior adviser Dan Pfeiffer and adviser John Podesta. Podesta has a son serving in the country.
Air Force One departed from Joint Base Andrews at 11 p.m. Saturday. Media were not alerted to the trip and those traveling with him were barred from reporting on the travel until he arrived. Air Force one will make a brief stop at a U.S. base in Germany to refuel.
--This report was updated at 6:46 p.m.