BAGRAM AIR FIELD, Afghanistan — In a swift and secretive trip to the war zone, President Barack Obama signed an agreement Tuesday night vowing long-term ties with Afghanistan after America's combat forces come home.
Seated beside Afghan President Hamid Karzai, Obama declared, "Together, we're now committed to replacing war with peace."
The partnership spells out the U.S. relationship with Afghanistan beyond 2014. It is limited in scope and essentially gives both sides political cover: Afghanistan is guaranteed its sovereignty and promised it won't be abandoned, while the U.S. gets to end its combat mission in the long and unpopular war but keep a foothold in the country.
Obama also was to give a speech designed to reach Americans at the dinnertime hour of 6:30 p.m. CDT. That would be 4 a.m. here when Obama speaks.
Obama slipped out of Washington, flew all night to Bagram, then shuttled by helicopter under a moonlight sky to Kabul to help two strained allies try to turn from war to peace — or at a least stable end to the war. He was greeted by U.S. ambassador Ryan Crocker.
At the signing ceremony in Kabul with Karzai, Obama said the agreement paves the way for "'a future of peace" while allowing the United States to "wind down this war."
The deal does not commit the United States to any specific troop presence or spending. But it does allow the U.S. to potentially keep troops in Afghanistan after the war ends for two specific purposes: continued training of Afghan forces and targeted operations against al-Qaida. The terror group is present in neighboring Pakistan but has only a nominal presence inside Afghanistan.
Obama said the deal was meant in part to pay tribute to the more than 1,800 U.S. troops who have died in Afghanistan since the war began. He also underlined his message to Afghans.
"With this agreement I am confident that the Afghan people will understand that the United States will stand by them," he said.
Karzai said his countrymen "will never forget" the help of U.S. forces over the past decade. He said the partnership agreement shows the United States and Afghanistan will continue to fight terrorism together. The United States promises to seek money from Congress every year to support Afghanistan.
After the signing ceremony in Kabul, Obama flew back to Bagram Air Field. There he offered words of encouragement to assembled U.S. troops. Obama was to be on the ground for about seven hours in Afghanistan.
"There's a light on the horizon," he said after cautioning in somber tones that the war's grim costs were not yet fully paid.
"I know the battle's not yet over," he said. "Some of your buddies are going to get injured. And some of your buddies may get killed. And there's going to be heartbreak and pain and difficulty ahead." He added that his administration is committed to ensuring that once the war is over, veterans will be given their due.
Officials have previously said as many as 20,000 U.S. troops may remain after the combat mission ends, but that still must be negotiated.
The wars here and in Iraq combined have cost almost $1.3 trillion. And recent polls show that up to 60 percent of Americans oppose the U.S.'s continued presence in Afghanistan.
The president's Tuesday night address was coming exactly one year after special forces, on his order, began the raid that led to the killing of Osama bin Laden in Pakistan.
Since then, ties between the United States and Afghanistan have been tested anew by the burning of Muslim holy books at a U.S. base and the massacre of 17 civilians, including children, allegedly by an American soldier.
Media traveling with Obama on the 13-plus-hour flight had to agree to keep it secret until Obama had safely finished the helicopter flight to Kabul.
Obama has gone twice before to Afghanistan as president, most recently in December 2010, and once to Iraq in 2009. All such trips, no matter how carefully planned, carry the weight and the risks of considerable security challenges. Just last month, the Taliban began near-simultaneous assaults on embassies, government buildings and NATO bases in Kabul.
Still, it would have been unusual for Obama to sign the "strategic partnership" agreement without Karzai at his side.
The deal is essential for locking in America's commitment and Afghan's sovereignty when the post-war period comes. Negotiations have dragged as Afghan officials have demanded specific assurances, financial and otherwise.
Both sides have scrambled to get a deal before the NATO conference in Chicago later this month. Negotiators seemed to clear the way for Obama and Karzai by finding agreement over the conduct of night raids and authority over detainees.
The United States has 88,000 troops in Afghanistan. An additional 40,000 in coalition forces remain from other nations.
Obama has already declared that NATO forces will hand over the lead combat role to Afghanistan in 2013 as the U.S. and its allies will work to get out by the end of 2014.
One important unsettled issue, however, is how many U.S. troops may remain after that.
U.S. officials are eying the 20,000 residual forces to work mostly in support roles for the Afghan armed forces, and some U.S. special forces for counterterror missions. The size and scope of that U.S. force — if one can be agreed upon on at all, given the public moods and political factors in both nations — will probably have to be worked out later in a separate agreement.