Before Kurdish and U.S. commandos arrived at his cell door last month, Hassan Abu Ahmed had not seen daylight for five months.
Held in an Islamic State prison near the northern Iraqi town of Hawijah, the 46-year-old was accused of being a spy and regularly tortured.
Sometimes a plastic bag was placed over his face until he nearly suffocated. He was electrocuted, beaten with plastic pipes and whipped with electric cable. There were mock executions.
Two prisoners held in the facility described life in an Islamic State prison and the mission that set them free. The operation, which a Kurdish commando also detailed, freed 69 detainees and was the first confirmed time that U.S. troops had directly accompanied Iraqi forces on the battlefield in the fight against the Islamic State.
The raid in Hawijah was supposed to be led by Kurdish forces, but U.S. troops were called in when they were pinned down.
The operation was planned over five days, said a Kurdish commando who participated in the raid and spoke on the condition of anonymity, citing security protocol. The United States was asked to play a "logistics and support" role.
Abu Ahmed had been accused of supplying information to Kurdish authorities, something he admits he had done.
Abu Ahmed's frequent trips to the nearby city of Kirkuk, outside the Islamic State's territory, had raised suspicions. When the militants seized control of Hawijah, about 150 miles north of Baghdad, in June 2014, he had resisted pressure to join them.
Life in the town went from "white to black" when the militants took over, he said.
In May, five armed Islamic State members appeared at his house to arrest him. After he was blindfolded and driven to prison that day, he did not see daylight for another five months.
He said he prayed for rescue but had little hope it would come.
But at 2 a.m. on Oct. 22, Kurdish special forces launched their mission - accompanied by about 30 U.S. troops. U.S. Chinook and Black Hawk helicopters also took part.
Abu Ahmed heard the helicopters draw closer. When the guards started shouting, he realized that a rescue attempt was underway.
"Paratroopers, paratroopers!" the guards yelled in the confusion, he said. U.S. and Kurdish officials say no paratroopers were involved, with helicopters landing about 30 yards from the prison.
In another cell, Qassim Awad, 36, was jolted awake by the shouting guards.
"We heard the helicopters," he said. "We were all scared and went to the bathroom and hid."
Awad said he was in prison for attempting to escape Hawijah with his two wives and 10 children. He had been in prison for about two weeks before the rescue attempt.
Qassim Awad, 36, a former soldier and truck driver was freed from an Islamic State prison after a dramatic raid by US and Kurdish special forces in his home town of Hawija last week.
The prisoners' accounts of why they were held could not be independently verified. A Kurdish security officer was present during their interviews, which took place in a security building in Irbil. Two weeks after the raid, the former detainees are still being processed by Kurdish and U.S. authorities, with concerns that some may be Islamic State sympathizers who were arrested for minor offenses.
Awad said the prison's main interrogator, a militant from neighboring Diyala province, was called "Abu Hajjar." Awad, a truck driver who had served in the Iraqi military, said he lost some of his hearing after being beaten on the head with a plastic pipe.
"I confessed," he said. "I couldn't handle the torture. Other prisoners told me about the electric shocks, and I couldn't handle it. I decided death was the best way out, but then they came."
Awad had put his fingerprint to a written confession, though he doesn't know what it said because he was blindfolded at the time, he said.
He said he had been told that he was awaiting judgment from an Islamic State court, but he was expecting to be executed.
On the night of the raid, the Kurdish commando said his team came under fire from the prison guards as soon as the helicopters landed. The plan was for Kurdish forces to take the lead.
"They attacked us straight away," he said. "At that stage we were leading the offensive." The Kurdish forces fought back, killing two guards, he said. His team attempted to enter one of several buildings in the prison, formerly a house.
But then they came under fire again. "We were involved in an intense firefight so we requested support (from the Americans)," the commando said. "During that intense firefight, it was unfortunate that the American officer was martyred."
When the U.S. forces and Kurdish forces reached Awad's cell, he said, one prisoner who spoke some English cried out, "Please help us! Please help us!" The prisoners were searched and handcuffed before being sat on the grounds to wait to be airlifted out.
Kurdish forces searched for their peshmerga colleagues, but none were found.
Six Islamic State militants were arrested, according to Kurdish authorities, and 20 were killed. In a video released in the aftermath, the Islamic State said just six militants had held off the attack, which it described as a "failed operation." Twenty-five prisoners were killed, it claimed. The video showed four peshmerga being executed on the bombed remains of the compound in retaliation for the raid.
"Obama, you have learned a new lesson," a masked Islamic State militant said in the video. "You did not gain anything, you returned to your bases, and with losses and humiliation."
The American killed was Master Sgt. Joshua L. Wheeler, who had served 14 tours in Iraq and Afghanistan. He was 39.
His actions and those of one of his colleagues protected those who were involved in breaching the compound and made the mission successful, Carter later said.
"He was a capable officer. He will leave behind a gap," said the Kurdish commando.
OpenAI Blocks Iranian Group's ChatGPT Accounts For Targeting US Election Video: Private Equity CEO Arrested After Body-Slamming Teen At US Restaurant US Court Calls Google Monopolist, Says It Violates Competition Law Parents Gave Names Of Interns, Doctors To CBI In Kolkata Horror: Sources Who Is Jasveen Sangha, "Ketamine Queen" Charged With Matthew Perry's Death How Extreme Weather Is Leading To Rise In Child Marriages In Pakistan Police Arrest Suspect In Bihar Dalit Girl Kidnapping, Murder Case 80 Killed In Paramilitary Attack In Sudan OpenAI Blocks Iranian Group's ChatGPT Accounts For Targeting US Election Track Latest News Live on NDTV.com and get news updates from India and around the world.