A more aggressive US strategy in Afghanistan has put the Taliban on the back foot, soldiers and police say, but recent, bloody attacks in Kabul show the group remains potent and a prolonged stalemate looms.
President Donald Trump in August unveiled a more hawkish military approach, including a surge in air attacks, aimed at forcing the Taliban to the negotiating table.
While Afghan security forces say the effect has been significant, the Taliban are still mobile in huge swaths of the country and, with foreign troop levels at about 15,000 compared with 140,000 in 2014, there appears little hope of outright military victory.
"The American air attacks have broken their back," said Nasrullah, a soldier in Kunar province on the Pakistani border. "They don't dare attack in large numbers because they know they'd all get killed. Without air support, we'd be struggling."
The Taliban made gains after NATO withdrew most of its combat troops in late 2014. Two years later, they were threatening several district centres and even two provincial capitals, including Kunduz, in the north, which was briefly captured.
Now the fighters no longer threaten the city, said Kunduz police chief Abul Hameed Hamidi.
Air attacks had been a "game changer", he said, along with a revived campaign of "night raids" aimed at capturing fighter leaders, which previous President Hamid Karzai banned because they were so unpopular.
Soldiers and police in districts outside Kunduz that were contested a year ago said the war had tilted in their favour.
"They can't face us and instead hide among civilians, plant roadside bombs and carry out suicide attacks," said soldier Abdul Karim.
Changed the picture
In Helmand province in the south, the Taliban have been pushed back 30 km from the provincial capital, Lashkar Gar, said governor Hayatullah Hayat, who also credited air attacks.
There were fears last year that the town could fall.
Helmand policeman Baz Gul said the air attacks had "changed the picture completely" and morale was high.
The US air attacks in Afghanistan in 2017 shot up to 4,361, according to US data, compared with 1,337 the previous year.
NATO's Resolute Support mission said on Tuesday the air campaign had been expanded in the north, with B-52 bombers striking Taliban positions.
The mission commander, General John Nicholson, said that the Taliban fighters could not win on the battlefield.
A Taliban spokesman denied that air attacks had forced fighters to flee, saying they were still operating in district centres and across the countryside.
According to a recent BBC study, the Taliban are openly active in 70 percent of districts. A spokesman for the NATO mission said the BBC estimate overstated the insurgents' "influence impact" and only about 12 percent of the population was under full Taliban control.
Thomas Ruttig of the Afghanistan Analysts Network think-tank told Reuters there were limits to what air power could achieve, while pointing out that the number of civilian casualties had risen, which could be used by the Taliban for propaganda.
"Pushing the Taliban back is not victory over them," he said. "The Taliban have proven that they are able to adjust and out-wait such campaigns before."
Escalating violence, including clashes with Islamic State in Iraq and Levant (ISIL, also known as ISIS) in Afghanistan forced 360,000 people from their homes in 2017, with more than 2,600 civilians killed, according to the United Nations.
Trump rejected talks with the Taliban after a January 27 bomb in Kabul killed 103 people, a week after a Taliban attack on a hotel killed four Americans and some 26 Afghans. But the long-term US aim remains to force the Taliban into a settlement, a top US official said later.
The Afghan government has also taken a tougher stand on talks, while the Taliban say negotiations depend on foreign troops leaving. They said the Kabul attacks were a response to Trump's aggression and threatened more.
The International Crisis Group think-tank said that, while US officials say their diplomatic and military efforts are aimed at reaching a settlement to the US' longest war - which officials estimate will cost taxpayers more than $45bn this year - diplomacy has clearly been downgraded.
"The US and Afghan governments hope a peace process will emerge from the ashes of this intensified military campaign, but a peace process has never been more remote in recent years," said the group's senior Afghan analyst, Borhan Osman.
"Both sides are unleashing more violence based on the same rationale that it would tilt this stalemate to favour their conditions at the table."
Afghan forces are steeling themselves for a drawn-out fight with a well-armed enemy.
"There must be another way out of this," said Sher Wali, a policeman in Nangarhar province. "Because it looks like it'll never end."