NATO has approved a landmark plan to hand over Afghan security to local forces by the middle of 2013 and withdraw combat troops by the end of 2014.
At a two-day summit in Chicago, the alliance also said it would leave behind a training mission and vowed Afghanistan "will not stand alone" after the withdrawal.
"We are now unified behind a plan to responsibly wind down the war in Afghanistan," U.S. President Barack Obama told the summit's closing news conference.
Obama acknowledged serious challenges remain in Afghanistan and described the Taliban as a "robust enemy."
"I don't think there's ever going to be an optimal point where we say, 'This is all done. This is perfect. This is just the way we wanted it and now we can wrap up all our equipment and
go home,'" Obama said. "This is a process, and it's sometimes a messy process."
Earlier, NATO Secretary-General Anders Fogh Rasmussen said the participants had agreed on three key points regarding Afghanistan.
He described these three points as "the next stage of our engagement until our mission is completed at the end of 2014, the role for NATO after 2014, and thirdly, our support for the sustainment of future Afghan security forces."
Rasmussen also declared that the decision to hand over security in the country to Afghan forces was "an important milestone" in NATO's involvement in the 10-year conflict in Afghanistan.
Afghanistan’s ambassador to the United States said his country is grateful for the support that NATO allies have pledged and is looking forward to an enduring partnership with the alliance in the years to come.
Eklil Hakimi told RFE/RL
that agreements reached between Karzai and the United States and its NATO partners will send a strong message to the region and assure the Afghan people that Kabul will not be left on its own after NATO ends its combat mission in the country in 2014.
Hakimi also said that Afghan forces will be ready by the time NATO hands over the lead on fighting by mid-2013.
Optimism Over Pakistan Supply Routes
At the Chicago conference, NATO also called on Pakistan to reopen a key supply route into Afghanistan "as soon as possible" and thanked Russia and Central Asian governments for allowing supply convoys through their territory.
Pakistan shut its borders to NATO supplies in November after an alliance air raid that left 24 Pakistani soldiers dead.
Pakistani President Asif Ali Zardari's presence at the summit had raised hopes that the route would be reopened, but Zardari's scheduled session with Rasmussen was called off.
Obama spoke of "diligent progress" but no breakthrough with Zardari on the supply lines issue after they spoke briefly on the sidelines of the summit.
"We didn't anticipate that the supply line issue was going to be resolved by this summit. We knew that before we arrived in Chicago," Obama said.
The U.S. commander in Afghanistan, General John Allen, told Reuters he was confident a deal would eventually be struck, but "whether it's in days or weeks, I don't know."
Afghan Funding Pledges
NATO also said in a joint summit declaration that the 228,500 Afghan troops that Kabul is expected to require in the long term will cost an estimated $4.1 billion per year.
The Afghan government is expected to come up with $500 million from its own budget.
Meanwhile, British Prime Minister David Cameron said NATO allies and their partners in Afghanistan have pledged almost $1 billion.
Cameron said Australia, Denmark, Estonia, Germany, Italy, and the Netherlands are among the most recent countries to have promised contributions. He added that Britain is planning to provide $111 million a year.
Separately, Rasmussen said Italy had pledged $120 million, Australia $100 million, and Turkey $20 million.
Meanwhile, protests against the summit continued for a second day in Chicago, although the demonstrations were notably smaller than weekend protests that drew thousands.
A clash following a large protest on May 20 resulted in more than 40 arrests.
With reporting by RFE/RL correspondent Heather Maher in Chicago, AFP, AP, and Reuters