President Hamid Karzai has said his government and Nato have failed to provide Afghans with security, 10 years after the Taliban were overthrown.
Speaking to the BBC, Mr Karzai also accused Pakistan of supporting the insurgency, saying sanctuaries there still needed to be tackled.
He vowed to step down in 2014 and said he was working on the succession.
His comments come as the ex-commander of coalition forces said Nato allies remain far from reaching their goals.
After a decade of fighting in Afghanistan, retired Army General Stanley McChrystal estimated that the coalition was "a little better than" half way to achieving its military ambitions, adding that the US began the war with a "frighteningly simplistic" view.
In his interview with the BBC, President Karzai also traced some of Afghanistan's current insecurity to military strategy in the early years of the war and the failure to tackle the Taliban sheltering in Pakistan's volatile tribal areas.
"Nato and the US and our neighbours in Pakistan should have concentrated a long time back, in the beginning of 2002-3, on the [Taliban] sanctuaries," he said.
Although he was eager to emphasise achievements in education and health, President Karzai admitted that security was his greatest failing.
"We've done terribly badly in providing security to the Afghan people and this is the greatest shortcoming of our government and of our international partners," he said.
"What we should do is provide better and a more predictable environment of security to the Afghan citizens and in that the international community and the Afghan government definitely have failed."
In recent months Afghanistan has seen a string of brazen assaults on major cities and military targets as well high profile assassinations, such as the killing last month of Afghan peace envoy and former president Burhanuddin Rabbani.
Mr Karzai said that it was a "serious shortcoming" that the Taliban were able to launch such spectacular attacks but also added that "these problems come from abroad" and pointed the finger at Pakistan's role in the Taliban insurgency.
"On the overall policy of Pakistan toward Afghanistan and towards the Taliban, definitely, the Taliban will not be able to move a finger without Pakistani support," he said.
He added that the president and prime minister of Pakistan were eager for good relations with Afghanistan but re-emphasised that Taliban sanctuaries in Pakistan will not go away unless the government there co-operates with the Afghan administration.
Pakistani authorities deny any support for the insurgents.
President Karzai also admitted that the policy of talking to the Taliban had received a serious blow with the assassination of ex-president Rabbani but added: "Find an address, find a location, and we will talk to you."
But as Nato begins to draw down troops in anticipation of relinquishing its combat role in 2014, Mr Karzai also confirmed that he would step down from the presidency in that year. He added he was starting work to find a successor.
Meanwhile, in a statement exactly 10 years after the US and their allies overthrew of the Taliban, US President Barack Obama saluted the more than half a million Americans who have served in Afghanistan - and the nearly 1,800 who have lost their lives there.
"Thanks to the extraordinary service of these Americans, our citizens are safer and our nation is more secure. In delivering justice to Osama Bin Laden and many other al-Qaeda leaders, we are closer than ever to defeating al-Qaeda and its murderous network," Mr Obama said.
"After a difficult decade, we are responsibly ending today's wars from a position of strength," he went on to say, referring to the US operations in Iraq as well as Afghanistan.
Despite the advances in Afghan health and education, rights groups and aid organisations say many challenges remain.
Some $57bn (£37bn) of aid has been spent over the past decade, according to the non-governmental organisations who form part of the Agency Co-ordinating Body for Afghan Relief, but, while some gains have been made, the spending has not always translated into real improvements for many Afghans.
And a decade of conflict has left many dead. The UN says that more than 10,000 civilians have died in violence in the past five years alone. More than 2,500 international troops have been killed - most of them American. The conflict has already surpassed Vietnam to become the longest war in US history.
Correspondents say Western officials admit that parts of the country will remain violent after 2014 when Nato stops fighting. Without a peace deal with the Taliban, they say, few really expect the war to be brought to an end.