A rush to withdraw from Afghanistan is not an option for NATO despite mounting political and security problems, the alliance's leader will say in a speech on Wednesday, Reuters reported.
NATO Secretary-General Anders Fogh Rasmussen will say he is concerned the public debate on Afghanistan "has started to go in the wrong direction".
"Of course, I know why. We are losing soldiers from our countries to Taliban attacks," he says in the draft of a speech prepared for a NATO ceremony in the United States, a copy of which was seen by Reuters.
"The allegations of fraud during the (Aug. 20 presidential) elections are disturbing. And there is a sense amongst many people, in many countries, that we are not making progress fast enough."
But he adds: "We must stay in Afghanistan as long as necessary, and we will stay as long as necessary. Let no one think that a run for the exits is an option. It is not."
NATO is trying to help stabilise Afghanistan and defeat an Islamist insurgency. It hopes to avert a public backlash over an air strike in Afghanistan last week which local officials said killed scores of people, many of them civilians.
In his speech Rasmussen says that although the Western military effort is difficult and costly, the 28-nation defence alliance would pay a much higher cost were it to leave.
"Terrorists in Afghanistan, and (planning attacks) from Afghanistan. Profound instability in Pakistan, and in Central Asia. Extremists from around the world emboldened. This is simply not a future we can allow to happen."
"What we cannot and will not do is waver. Success in our effort is essential to Afghan security, to regional security and our security. And we will get there."
Rasmussen says the need for a clear step towards transition to Afghan leadership of the country and for NATO member states to invest more in training and developing the Afghan security forces.
He backs a call by France, Germany and Britain for a conference to focus on transition in civilian sectors.