But he had to find out. Both he and his younger brother Abdul had been haunted by dreams in which their father visited them, still alive.  Zia’s 15-day journey to find his father took him deep into Taliban territory, in the opium poppy belt in the south. He had to wait outside a Taliban court in a mosque in Now Zad, as land disputes and robberies were settled by a portly insurgent leader, before he could get his visit approved.  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.  “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.  Noor ul-Haq was lost to his family again. But this time his relatives did not have to wait as long for the twist.  A month later, another Afghan Special Forces raid in an adjacent district freed Mr. Haq, Mr. Ibrahimkhel and about 60 others. The two men would later learn the details of the ordeal their families had been put through.  The army demanded that the two men return the death money. Both were insulted, and crushed.  Army officials say no one is to blame, really. The embattled outposts are remote, and sometimes it takes months before bodies can finally be shipped back, badly damaged and decomposed. It can be impossible to sort out who died, who deserted and who might have been taken alive.  Gen. Dawlat Waziri, a spokesman for the Afghan Ministry of Defense, described the cases of Mr. Haq and Mr. Ibrahimkhel as the “misery of the ongoing war.” He insisted that Mr. Haq and Mr. Ibrahimkhel would meet the minister of defense soon so the minister could praise their bravery and provide assistance.  “They don’t have to pay anything,” General Waziri said.  But now both men are back in Helmand Province, trying to recover the back salary that was seized to repay the death compensation. In phone interviews, both said they saw no signs that their debt had been erased.  “It’s been 17 months that I have not gone home,” Mr. Ibrahimkhel said. “My youngest child was 7 or 8 months old when I left. Now he probably won’t recognize me.”  Mr. Haq’s family had already spent most of the compensation payment on a painful cycle of wakes and celebrations.  “Guests were coming and coming — at first, when we heard that he was killed and the body arrived,” Zia said. “Then, again, when we heard he was alive, people came to celebrate. Then, when we heard that he may have died again, people came again. And when he finally arrived, such big crowds came that I didn’t even know most of them.”  Every time, they all had to be fed.  On his third day home, Mr. Haq walked to the cemetery with the help of one of his sons. The strip was crowded with graves of soldiers and policemen, many of whom had died in Helmand, the Afghan flag hoisted on their graves. He crouched by the headstone of what was supposed to be his own grave, offering a prayer for the unknown man buried there.  But two months later, Mr. Haq was back in Helmand, trying to get his remaining salary released and, perhaps, to sign up for another three years in the army.  Trying to explain his father’s new absence, Mr. Haq’s 4-year-old son, Helal, put it this way: “My father went to bring rice.”  Ahmad Shakib contributed reporting from Kabul, and an employee of The New York Times from Helmand Province.  A version of this article appears in print on April 18, 2016, on page A1 of the New York edition with the headline: Declared Dead in Afghan War, Then Living With Funeral Debt. Order Reprints| Today's Paper|Subscribe
The families of two Afghan men experienced the trauma of their deaths, the joy of hearing they were alive, then the shock of a government demand that it get its money back.