For more about the country and the war, read the Afghanistan Crossroads blog.
Lisbon, Portugal (CNN) -- NATO and the Afghan government on Saturday forged a "long-term" partnership declaration -- an agreement that will leave international forces in the war-torn country for many years after a planned military transition in 2014.
"We will stay as long as it takes to finish our job," said Anders Fogh Rasmussen, NATO's secretary-general.
"NATO is in this for the long term. We will not transition until our Afghan partners are ready. We will stay, after transition, in a supporting role," he also said.
He and Afghan President Hamid Karzai signed the pact before reporters at the NATO summit in Lisbon. Along with U.N. Secretary-General Ban Ki-moon, they made remarks and took questions from reporters.
"Today marks the beginning of a new phase in our mission in Afghanistan. We will launch the process by which the Afghan government will take leadership for security throughout the country, district by district, province by province. The direction, starting today, is clear: towards Afghan leadership and Afghan ownership," Rasmussen said.
NATO, whose International Security Assistance Force has been battling insurgents for years in Afghanistan, will start transferring security leadership to Afghans next year, with a goal for Afghans to be in the lead by 2014.
"That is the vision President Karzai has set out. It is a vision we share, and we will make it a reality, starting early next year," Rasmussen said.
As the changeover occurs, coalition forces will focus on supporting roles, such as training soldiers and police, and helping the country develop its government, infrastructure and economy.
The agreement reaffirms NATO's "enduring commitment to Afghanistan's security and stability."
When asked about the transfer timetable however, Rasmussen said, "I don't foresee ISAF troops in a combat role beyond 2014, provided, of course, that the security situation" permits a "more supportive role."
"Let me stress the agreement we have signed today is not only a signal to Afghan people we will stay committed," Rasmussen said, "it's a signal we won't leave behind a security vacuum that could create instability."
Karzai -- who has been critical of international troops in Afghanistan, in part for their role in causing civilian casualties -- was pleased by the "keen awareness" among world leaders in Lisbon toward the "realities" in the country.
He also said the leaders were supportive of the country's efforts to reach out and make peace with insurgents, citing the formation of the High Peace Council -- a group dedicated to pursuing peace with militants.
"On all the agendas, I found voices of concord and agreement from world leaders," he said.
NATO said ISAF leaders "reaffirmed their support for the Afghan-led process of reconciliation and re-integration."
"There was also agreement that these Afghan-led efforts to reconcile and re-integrate insurgents are for those fighters who renounce violence, cut links with terrorist groups and accept the Afghan constitution," NATO said.
Both Karzai and Rasmussen stressed their optimism over the transition plan. Karzai said the "determination and hard work" of the Afghans and the "strong commitment" of the international community will make the plan work.
Rasmussen cited improvements across the country. A decade ago, he said, Afghanistan was "torn apart." Since then, there have been strides militarily and in other sectors, citing the "rapid growth" in security force numbers.
Ban lauded what he called a "successful meeting."
"As we move ahead, we must be guided by realities, not schedules. Let us remember Afghanistan has been at war for decades," Ban said. "There are no short cuts to peace. The U.N. is committed to supporting the Afghans over the long term."
The U.S. and NATO allies are looking to turn two or three Afghan provinces over to Afghan control by June, with "several more" in the summer or fall.
"Starting early next year, Afghan forces will begin taking the lead for security operations," Rasmussen said.
"This will begin in certain districts and provinces, and based on conditions, will gradually expand throughout the country. The aim is for the Afghan forces to be in the lead country-wide by the end of 2014."
Some of those targeted for the first transition include the relatively calm provinces of Parwan, Bamiyan and Panjshir, CNN Pentagon Correspondent Barbara Starr reported earlier this week.
"But of course, we cannot succeed alone. The military is necessary, but we need a true comprehensive approach. That is a clear lesson of our experience in Afghanistan," Rasmussen said.
Some coalition countries are already backing that approach.
Canada, which is ending its combat mission in Afghanistan in July, announced Tuesday "a new role" to play in the war-torn nation, with a focus on security, diplomacy, human rights and development.
And a senior U.K. official confirmed Saturday that what British Prime Minister David Cameron has said publicly remains official policy: No matter how violent Afghanistan is at the end of 2014, the British will end combat operations by 2015.
The official says the process is on track to "begin transition in some provinces in early 2011" and that despite the country's vow to stop fighting in four years, the British will remain involved in Afghanistan in a noncombat role.
"The alliance's commitment to Afghanistan will endure beyond ISAF's current mission," the official said.
NATO said the leaders at the gathering welcomed the bolstering of "the strength, equipment and capabilities" of Afghan troops. It said Afghan security force numbers are "on track to reach 300,000 by the end of 2011."
The agreement addresses the civilian casualty issue, and it comes a day after three Afghan civilians were accidentally killed and four others were wounded during an operation in Kunar province, in Afghanistan's east.
Typifying the kind of incident that has undermined international credibility in Afghanistan, troops used mortar rounds to return fire against insurgents, but three or four rounds landed short of the targeted area, near a village.
"Any civilian casualty is a tragedy," the declaration said. "We strongly condemn the intentional targeting of civilians by insurgents, who have caused the overwhelming majority of civilian deaths and injuries in Afghanistan.
"At the same time, we will continue to take all necessary steps to shield civilians from harm, measures that have already contributed to a substantial decrease in civilian casualties caused by ISAF and Afghan forces."
The partnership declaration urges the Afghan government to tackle government corruption and improve governing.
"This will help translate security gains into political gains and promote stability," the agreement said.
Also, Rasmussen announced stronger ties between the alliance and Russia, including the completion of arrangements for expanded transit of equipment to ISAF troops.
CNN's Chris Lawrence contributed to this report