When the Taliban swept into Kabul last month, capturing Afghanistan's capital without a fight, the sheer speed of the collapse of the Western-backed and trained army stunned the world.
But senior officials in the former Afghan administration said that the lightning victory was not entirely unexpected, and the consequence of fundamental leadership failures, rampant corruption, slick Taliban propaganda -- and a crushing "betrayal" by US-led forces with their hasty pullout.
One top official close to the centre of power said that just two days before Taliban forces entered Kabul on August 15, he was present as former president Ashraf Ghani held an emergency meeting with his senior ministers, and military and spy chiefs.
"It was said that we had enough weapons, ammunition, and financial resources to hold Kabul for two years," said the official, who claimed $100 million in cash was available to secure Kabul.
"It didn't protect the city for two days," he said.
The official, who like most sources AFP spoke to for this article did not want to be identified for fear of reprisals, said he was not surprised by the capitulation.
"Ministers were lying to Ghani, telling him that everything was fine, so they could keep their jobs and their privileges," he said.
As the Taliban raced through the country, the inner circle debated policy reforms.
"We didn't get our priorities right," he added.
"As the cities fell, one after the other, the National Security Council met to talk about recruitment and institutional reforms."
Taliban forces swept across the country in just two weeks, seizing provincial capitals often without a bullet being fired.
Another top ex-government official said nobody at the top showed leadership.
"None of them spoke to the media to reassure our men. None of them went into the field," he said.
Ghani also made basic strategic mistakes, the close adviser added.
"I suggested we leave the south, as we didn't have enough manpower to defend it in the long term.
"But the president disagreed. He said that all Afghanistan belonged to the government," he said.
But for the Afghan army, holding everywhere against the Taliban was an impossible task.
Despite the billions of dollars of US-led military support, equipment and training, the army's capacity had been hollowed out by years of rampant corruption.
Senior officers creamed off what they could, stealing salaries from lower ranks, as well as selling fuel and ammunition supplies.
The situation worsened after Washington struck a deal with the Taliban in February 2020 for a troop withdrawal agreement.
"We were betrayed," said Sami Sadat, a general recognised for his bravery against the Taliban, who was brought in to lead the special forces in Kabul just days before its fall.
Without the critical protection of US air support -- and with the former government's own air force grounded after foreign contractors maintaining the fleet were pulled out by Washington -- the army lost its strategic advantage.
"The Taliban were emboldened," Sadat said, writing in the New York Times.
"They could sense victory... Before that deal, the Taliban had not won any significant battles against the Afghan Army. After the agreement? We were losing dozens of soldiers a day."
The final days of fighting were "surreal", Sadat added.
"We engaged in intense firefights on the ground against the Taliban as US fighter jets circled overhead, effectively spectators," he wrote.
Sadat dismissed the claim by US President Joe Biden that the Afghan had collapsed sometimes "without trying" to fight.
"We fought, bravely, until the end," Sadat said. "We lost 66,000 troops over the past 20 years; that's one-fifth of our estimated fighting force."
For the soldiers on the frontlines, they saw little reason to die when top leaders were fleeing.
"When the Taliban got to the gates of Kabul, the soldiers knew the president was leaving -- that's why they didn't fight," said a former senior army officer who asked not to be named.
At the same time, the Taliban deployed a savvy use of media messages to persuade soldiers to surrender, undermining morale even further.
"We had already lost the social media war," the first presidential confidante said.
"The Taliban were telling the soldiers that they were fighting needlessly because at a higher level an agreement had already been signed."
Abandoned and exhausted, soldiers saw little point in fighting on.
On August 15, 2021, Kabul fell without a fight.