U.S. President Barack Obama signed the strategic partnership agreement with his Afghan counterpart Hamid Karzai in the wee hours of Wednesday shortly after he arrived in the Afghan capital Kabul for a surprise visit, local TV channels reported.

According to local Tolo News, the agreement will grant stay for some U.S. troops after 2014 when most of the foreign soldiers withdraw.

Previously U.S. officials have said as many as 20,000 U.S. troops may remain in Afghanistan after the combat mission ends, but Afghan officials said it still has to be negotiated.

The surprise visit and the signing of the U.S.-Afghan strategic partnership pact coincided with the first anniversary of the killing of al-Qaeda leader Osama bin Laden by U.S. special forces in Pakistan.

The controversial agreement has been welcomed by local analysts as a security stabilizing factor in the militancy-ridden Afghanistan.

Before the pact was finalized, the Afghan government had signed two key deals with the United States which obliges U.S. military to hand over the charge of the Bagram detention center to Afghan administration and allows Afghan security forces to lead special operations including the controversial night raids.

According to a fact sheet provided by the White House, the Strategic Partnership Agreement "provides for the possibility of U. S. forces in Afghanistan after 2014, for the purposes of training Afghan Forces and targeting the remnants of al-Qaeda."

The White House said the U.S. side "do not seek permanent military bases in Afghanistan," but the agreement "commits Afghanistan to provide U.S. personnel access to and use of Afghan facilities through 2014 and beyond."

The 130,000-strong U.S.-led coalition forces, including 90,000 American troops, were originally scheduled to be pulled out of Afghanistan by the end of 2014.

VietNamNet/Xinhuanet