Updated

The U.S. and Afghanistan reached a deal Sunday on a long-delayed strategic partnership agreement that assures the Afghan people their key American ally will not abandon the country military or financially for years after 2014, the deadline for most foreign forces to withdraw.

The agreement is key to the U.S. exit strategy in Afghanistan because it provides guidelines for any American forces who remain after the withdrawal deadline and for financial help to the impoverished country and its security forces. For the Afghan government, it is a way to show its citizens that its key allies are not just walking away.

"Our goal is an enduring partnership with Afghanistan that strengthens Afghan sovereignty, stability and prosperity and that contributes to our shared goal of defeating Al Qaeda and its extremist affiliates," said U.S. Embassy spokesman Gavin Sundwall. "We believe this agreement supports that goal."

After 10 years of U.S.-led war, Taliban and Al Qaeda linked insurgents remain a threat and as recently as a week ago, they launched a large-scale attack on the capital Kabul and three other cities.

The draft agreement was worked out and initialed by Afghan National Security Adviser Rangin Dadfar Spanta and U.S. Ambassador Ryan Crocker and must still be reviewed in both countries and signed afterward by the Afghan and American presidents.

U.S. forces have already started pulling out of Afghanistan and the majority of combat troops are scheduled to depart by the end of 2014. But the U.S. is expected to maintain a large presence in the country for years after, including special forces, military trainers and government assistance programs.

The agreement is both an achievement and a relief for both sides, coming after months of turmoil that seemed to put the entire alliance in peril. It shows that the two governments are still committed to working together and capable of coming to some sort of understanding.

"The document finalized today provides a strong foundation for the security of Afghanistan, the region and the world and is a document for the development of the region," Spanta said in a statement issued by President Hamid Karzai's office.

Neither Afghan nor U.S. officials would comment on the details of the agreement. But it is believed to pledge a partnership for 10 years beyond the 2014 withdrawal deadline.

Reaching any agreement is likely to be seen as a success given more than a year and a half of negotiations during which the entire effort appeared in danger of falling apart multiple times.

Since the beginning of the year, U.S.-Afghan relations have been strained by an Internet video of U.S. Marines urinating on the corpses of presumed Taliban fighters, by Koran burnings at a U.S. base that sparked days of deadly protests and by the alleged killing spree by a U.S. soldier in a southern Afghan village. Tensions were further heightened by a spate of turncoat attacks by Afghan security forces on their international counterparts.

White House National Security Council spokesman Tommy Vietor said President Obama expects to sign the document before a NATO summit in Chicago next month, meeting the deadline set by the two sides. Many had started to worry in recent weeks that Karzai and Obama would miss that goal as talked dragged on and Karzai continued to announce new demands for the document.

Much of the disagreement was about how to handle activities that the Afghan government saw as threatening its sovereignty, in particular, night raids and the detention of Afghan citizens by international forces. Those two major issues were resolved earlier this year in separate memorandums of understanding.

But closed-door talks continued for weeks after those side-deals were signed. And then as recently as last week, Karzai said that he wanted the agreement to include a dollar figure for funding for the Afghan security forces -- a demand that would be hard for the Americans to sign off on given the need for Congressional approval for funding. U.S. officials have said previously that they expected the document to address economic and development support for Afghanistan more generally.

The final document is likely to be short on specifics. U.S. officials involved in the negotiations have said previously that the strategic partnership will provide a framework for future relations, but that details of how U.S. forces operate in the country will come in a later agreement.

The initialing ceremony means that the text of the document is now locked in. But the countries will have to go through their own internal review processes, Sundwall said.

"For the United States, that will mean interagency review, consultation with Congress as appropriate and final review by the president," Sundwall said.

In Afghanistan, the agreement will have to be approved by parliament. The Afghan foreign minister will brief Afghan lawmakers about the document Monday, the Afghan president's statement said.