Ten years after hastily going to war in Afghanistan, the United States is eyeing an honorable exit from the conflict after being forced to change strategy as it confronts a Taliban insurgency.
US forces entered Afghanistan in October 2001, just weeks after the attacks of September 11, in what was dubbed Operation Enduring Freedom and aimed at wiping out the Taliban regime blamed for sheltering Al-Qaeda's top leadership.
The US and its allies succeeded in quickly ousting the Taliban Islamic militants from Kabul, even though the goal was not "nation building," according to a memo from then defense secretary Donald Rumsfeld.
"The USG (US government) should not allow concerns about stability to paralyze US efforts to oust the Taliban leadership," Rumsfeld wrote.
But as the conflict wore on, the Taliban was able to regroup and reform thanks to their safe havens in the unruly Pakistani border areas and keep the insurgency going, which had not been in Washington's plan.
"The United States was surprised at the virulence of the Taliban attack that began in earnest in 2005," said Joseph Collins, a professor at the National Defense University and author of "Understanding War in Afghanistan."
"From 2002 to 2005, the Taliban rebuilt its cadres with drug money, 'charity' from donors in the Gulf states, and help from Al-Qaeda. Their sanctuaries in Pakistan enabled them to rearm, refit and retrain," Collins writes in his book.
"It is fair to say that post-2005, as the situation in Afghanistan began to decline, the greater scope and intensity of problems in Iraq prevented reinforcements or additional funds from being sent to Afghanistan... It was not until the obvious success of the surge in Iraq that US decisionmakers were able to turn their attention to the increasingly dire situation in Afghanistan."
Some say the lack of failure to rebuild Afghanistan and inability to root out Taliban sanctuaries ended up creating problems.
Seth Jones of the Rand Corporation said international aid for Afghanistan amounted to $52 per inhabitant in 2002-2004, compared with $1,400 in Bosnia a few years earlier.
This reflected "the decision by the US government not to spend a lot of time in Afghanistan," he said.
"The ability of groups to establish a safe haven or sanctuary in Pakistan meant that they could prepare and fight from areas where they were not touched and in particular in areas in Baluchistan," Jones said.
"That has clearly been one reason that has facilitated the emergence of an effective insurgency."
Although the Afghan government was set up under President Hamid Karzai, it has failed to stem the Taliban insurgency.
Jones said it was unrealistic to expect any central government to establish order throughout the country.
"Historically, there's no central government in Afghanistan's history," he said.
"The power structure is very rural and very locally based among tribes and clans, especially in Pashtun areas," Jones said.
"What it meant on the ground is up until very recently no major efforts to work with, leverage, co-opt Pashtun tribes, subtribes and clans. And the Taliban on the other hand worked really effectively on this level."
President Barack Obama's administration has pledged to begin a drawdown soon of US forces, which represent nearly 100,000 of the 140,000 international troops on the ground in Afghanistan, and to complete the withdrawal by 2014.
But some observers say this strategy is risky.
Retired lieutenant general David Barno, who commanded US forces in Afghanistan from 2003 to 2005, said the signal that the US wanted to leave Afghanistan made it harder to stabilize the country at the time.
"I think we signaled that we were getting out," he said, referring to the resurgence of the Taliban in recent years.
"Perceptions that the United States was leaving played a role. Our challenge essentially is how we leave Afghanistan and leave the region in a way that it doesn't become unstable and fall into civil war."