After pleading, Zia was allowed to briefly visit his father at the old school building the Taliban had turned into a prison. Noor ul-Haq was stooped, and barely able to walk. But hundreds of miles away from his grave in the Behsud cemetery, there he was, breathing, talking to his son.

The Taliban would not let him go, and Zia went home alone.

After the soldiers’ base was overrun, in the Musa Qala District of Helmand, Mr. Haq and his comrade Mr. Ibrahimkhel were among 10 soldiers who were taken captive by the Taliban, Mr. Ibrahimkhel said in a phone interview.

The new captives joined other prisoners from the security forces, 87 in all, Mr. Ibrahimkhel said. Every month, they would be moved to a different prison, sometimes in a different district, out of fear of a government raid.

After four months in captivity, when the world believed them dead, Mr. Ibrahimkhel gave a phone number to a visitor who had come to see a civilian prisoner. The visitor wrote the number on his leg, under the cuff of his pants, and later used it to call Mr. Ibrahimkhel’s family to let it know that he was alive. One of Mr. Ibrahimkhel’s brothers made a trip and finally found the prison in Now Zad.

Image Imamuddin Ibrahimkhel.

“They didn’t let us meet up close — just from 20 meters, to show that I was held by them and alive,” Mr. Ibrahimkhel said.

When the Afghan Special Forces raided the prison in Now Zad in December, Zia held out hope that his father had been freed. He made calls, but the news was not good: His father was not among the rescued. He was told that Mr. Haq may have been shot dead by the Taliban before the raid.