By day, they faced torture and the constant threat of execution at the hands of their ISIS captors. At night, they used a stolen piece of jagged metal to scrape the crumbling wall of their prison until last week, when they had fashioned a hole big enough to squeeze through.

A 30-year-old man who was one of 20 who fled the jail in Tabaqa, Syria, days later recounted the daring escape to the Syrian activist group Raqqa is Being Slaughtered Silently. As the prisoners poured out of the hand-hewn tunnel, running all directions into the night, a siren and the cries of a captured fellow escapee spurred him on until, exhausted, he reached the home of strangers. They hid him until he contacted a friend who came for him.

“Every day for three months they tortured him,” the friend, who is a member of the group of former residents of Raqqa now dedicated to shining a light inside the caliphate, where international media cannot go, told FoxNews.com.  “But after a while, the torture just became routine.”

The escapee, whose name and photo cannot be used for his own safety, is now in hiding near the Turkish border. He is one of several onetime prisoners of ISIS who clawed their way out of the terrorist group’s makeshift dungeons in Syria and Iraq and now tell similar, harrowing stories. Hussam Eesa, a member of Raqqa is Being Slaughtered Silently, said the accounts of former prisoners are vital for telling the outside world of the brutality inflicted on Syrians and Iraqis by ISIS.

The black-clad jihadist group operates three types of lockups, according to another former captive who escaped from a prison in Mosul. The dank basements of seized churches, hospitals, schools and office buildings hold imprisoned Iraqi Army officers and local policemen captured in cities overrun by ISIS. The prisoners are tortured, interrogated and most often killed in these prisons run by the Islamic State’s Department of Security.

“These people were mostly arrested after ISIS took over Mosul and Tikrit,” he said. “ISIS lied to them and told them, ‘We will give you safety if you give up your weapons,’ but then they arrested them. Many have been executed, but many are still in these prisons.”

He estimated that as many as 2,000 Iraqi Army soldiers have been killed since surrendering, with around 5,000 remaining in the bowels of prisons in Mosul, Tikrit and smaller towns controlled by ISIS.

ISIS’ jailors take mugshots of prisoners and meticulously record details of their lives, and often, their deaths.

So-called “public prisons,” run by ISIS’ Department of Enforcements, hold civilians deemed to be working against the occupying force. Offenses ranging from communicating with the Iraqi government to insulting an ISIS member to trying to flee the caliphate can warrant indefinite captivity in one of these prisons, according to the former Mosul captive. Inmates are beaten, lashed, maimed with sadistic tools and kept in small cages, the man, who was arrested for swearing at an ISIS fighter, told FoxNews.com.

“The number of people in these prisons goes up and down depending on the situation inside the city. There are many hundreds still in there,” he said.

It was one such prison where he was held, said the 25-year-old man. In addition to daily indoctrination into ISIS’ interpretation of the Koran and torture at the hands of their captors, the inmates are in constant fear of air attacks from Iraqi and coalition forces.

“They put us in a room where we could hear the planes echoing, the planes that fly over Mosul,” he said. “This scares the prisoners, we feel like we could be attacked at any minute.”

Many say the psychological torture -- hearing the plantive cries of fellow prisoners, being rousted from their quarters for mock executions and the constant reminders that each day could be their last -- is the worst part of capitivity inside the caliphate.

Food is scarce – two meals if lucky, he said. Breakfast is yogurt with tea and bread, and lunch is a little bit of potato, tomato and eggplant cooked in oil, he said.

The worst ISIS prisons are reserved for prisoners of war. Iraqi Army and Kurdish soldiers captured in battle are kept barely alive, only for the prospect of being used in exchanges.

“But they also kill some of them whenever ISIS gets harshly attacked in a fight,” the former captive said. “Or sometimes they just kill so they can use it to boost the morale of their own fighters.”

Women arrested by ISIS typically disappear behind prison walls never to be seen again. A document obtained by FoxNews.com from an ISIS jail in Iraq’s Saladin Province details the arrest of a woman in her mid-20s charged with prostitution. It lists full names and mother’s name, in addition to details such as date and place of birth, occupation, residence, marital status and place of arrest. She is presumed dead.

Even children are not excluded from the torment, say those who have been held prisoner by ISIS.

“A large number of children have been arrested by ISIS,” said Eesa. “The most common charges are insulting Allah and cooperating with apostates. They are being tortured just like men, and some of them have died under torture.”

Not praying, listening to Western music or showing disrespect to ISIS elders can all result in torture for children, Eesa said.

“They torture the children – mostly flogging, beating on the hands and feet,” Eesa said. “And psychological torture.”

According to the Office of the United Nations Human Rights Office of the High Commissioner (OHCHR), “ISIS continues to treat its detainees with brutality, subjecting some to torture and other ill-treatment, as well as to summary executions after unfair trials.”

The commission has published several reports documenting the extreme “violations of international human rights law” – from punishments involving amputation and overcrowded, insect-infested cells to the public display of crucified captives.

Short of a jail being liberated by opposing forces, escapes such as the one that took place last week are rare. Some prisoners, like the man who was held in Mosul, are released after finishing out their "sentences."

“One cannot get out, the roads around are usually under control of the Da’esh,” another Syrian source said. “In Raqqa seven months ago, some escaped in an airstrike. After that, almost no one.”

It remains unknown exactly how many people are being held in ISIS jails across Iraq and Syria, or even how many jails the barbaric terrorist group operates.

“I was administered with electric shocks, my bones were broken. I was hung by my feet from the ceiling and beaten with my hands tied behind my back,” a professional in his mid-40s, who was arrested in the very early days of the terrorist onslaught on suspicion of being an atheist, told FoxNews.com from a contested area inside Syria. “They swore on a Koran that I would be cut into pieces.”

The man claims that after a few days he was released to a hospital after connections affiliated with ISIS negotiated some kind of exchange or deal – but the experience still haunts him.

“I still feel like I am in jail,” he added. “But my mind is strong. I will keep fighting it.”

Steven Nabil contributed to this report.