Brussels - A few months before his killing rampage, convicted robber and prison inmate Benjamin Herman had a jailhouse conversion of a sort. A white suburban teen and a nominal Catholic when he was first incarcerated, he emerged in late May as an avowed Islamist who would murder three people within hours of gaining freedom on a work-release program.

Herman fatally stabbed two female police officers during his hour-long attack in the Belgian city of Liege, and then used one of their pistols to kill a passing motorist. Shouting "Allahu akbar," he seized a hostage and wounded two more officers before being shot dead in a gun battle with police.

Afterward, as the facts about the killings came to light, one biographical detail stood out: Herman, a product of Belgium's French-speaking middle class, had come under the sway of a group of radical Islamist inmates in prison.

Prisons hotbeds of radicalism

In a country that has acted aggressively to put extremists behind bars as a means of preventing terrorism, the attack stoked fears that Belgium's policy could be having the opposite effect, creating hotbeds of radicalism and sprouting new generations of would-be terrorists.

"Never have so many people been arrested on charges related to terrorism, and never have we seen so many of these guys in prison together," said Thomas Renard, a Belgian terrorism expert and researcher at the Egmont Royal Institute for International Relations in Brussels. "In bringing them together, we are facilitating their ability to recruit. And that is something that will stay with us for a long time."

Across Europe, prisons are the latest battleground in the evolving fight against Islamist-inspired terrorism. Beginning five years ago, Western countries saw thousands of their citizens migrate to Iraq and Syria to join Daesh or other Islamist groups.

Since 2016, hundreds have returned, but the mood at home has changed. Traumatized by terrorist attacks and a swelling refugee crisis, European countries since 2016 have taken a hard line on returnees, enacting tough laws that require criminal charges and incarceration for anyone who traveled to the Middle East or sought to support Islamists groups abroad.

Until 2016, many returnees were simply allowed to go home if there was no proof they had been fighters or involved in terrorist acts.

Race against time

Europe has seen fewer deaths from terrorist attacks since the policies went into effect. But now European officials are grappling with a new problem: how to prevent prisons from becoming training and recruitment centers for future terrorists.

From Belgium and the Netherlands to Germany and France, law enforcement officials are experimenting with markedly different approaches to the problem, including reeducation programs and the near-total isolation of the most radicalized inmates.

Human bombs

The efforts are a race against time, as many of the jailed returnees will regain their freedom in less than two years.

"They come to the end of their sentence, and we have no choice but to release them," said a Belgian official who helps supervise the treatment of Islamist inmates in that country's largest prisons.

The official, like several others interviewed, spoke on the condition of anonymity out of concern that former inmates might target them.

"Some of them," the official said, "could be human bombs."

Ittre Prison, a walled, high-security complex southwest of Brussels, is one of Belgium's most notorious, one-time home to convicted child molester and murderer Marc Dutroux and a host of organized crime figures.

In 2007, it was the site of a spectacular escape by Nordin Benallal, Belgium's "jailbreak king," who used a helicopter crash on the prison's grounds as a diversion that allowed him to escape.

Today, Ittre is known as one of two Belgian prisons with special isolation units for dealing with the most radical of the country's jailed Islamists. Called DeRadex, the unit is home to men regarded by Belgian officials as particularly dangerous. As of last month, Ittre's DeRadex section held 13.

The inmates in the section are allowed to socialize with others within the isolation unit only during certain hours and under close supervision. Isolation is, in fact, the essential ingredient in Belgium's new approach for dealing with radicalized prisoners: Although they may not be able to separate inmates from their extremist ideas, prison officials can at least prevent them from contaminating others.

Not all of DeRadex's inhabitants have been convicted on terrorism charges or even have a history of violence. But they are known and feared for their charismatic personalities and ability to draw others to the radical Islamist cause.

Islamists recruiting in DeRadex

"Every time we put them with the rest of the detainees, they engage in recruitment activities," said Valrie Lebrun, a 49-year-old Belgian criminologist who is the head of Ittre. "They become the imam. They push others to pray and change behavior."

During a recent tour of the facility, the DeRadex prisoners sat in solitary cells or carried blue yoga mats to the exercise yard as makeshift prayer rugs. Some wore their prison pants cuffed above the ankle, in the jihadist style.

In several cells, inmates had scratched Islamist graffiti onto walls and cell windows, including the name "Bel Kacem," a reference to Fouad Belkacem, founder of the extremist organization Sharia4Belgium. Belkacem is serving a 12-year sentence in another Belgium prison. Many of his recruits traveled to Syria and joined the Islamic State.

Within the regular prison populations, officials watch for changes in behavior that suggest radicalization is underway, such as when inmates modify their prison uniforms in jihadist style, or insist on wearing underwear when taking a shower, a reflection of conservative Islamist views about covering the body. In such cases, officials encourage inmates to meet with moderate imams and counselors who work with the prisons on a voluntary basis.

Some in Belgium argue that the prison officials simply aren't trying hard enough.

"The prisons are trying to quarantine the virus, but they don't really address the problem," said Ilyas Zarhoni, a Brussels imam who runs community programs that seek to counter extremist ideology. "We need experts in ideology, experts in psychology. The costs will be high, but it's nothing compared to what we could be dealing with when these people get out."

Already, Zarhoni said, juvenile detainees who spent time in Iraq or Syria are being released to schools and neighborhoods while still loyal to the radical Islamist cause. Among their peers, they are more likely to be viewed with admiration than with reproach.

"They're seen as heroes," Zarhoni said. "They've used weapons - how cool is that?"

Germany's different approach

A few hours' drive to the southeast, prison officials in the central German state of Hesse are trying a different approach, a kind of experiment in behavior modification that is playing out in real time.

At the JVA Frankfurt prison, there are no isolation units where extremist inmates are kept together. Instead, all prisoners share the same space, under a regimen of unusually close surveillance and intervention by a cadre of guards newly trained in spotting signs of radicalization.

German officials, blessed with bigger budgets and larger professional staffs compared with their smaller neighbors, are seeking to neutralize the radicalization threat one inmate at a time, with intense - and occasionally aggressive - management of each individual case.

The Hessian program, called Network for Deradicalization in the Penal System, or NeDiS, seeks to change inmates' thinking. Those who are labeled as radical - whether they are Islamists or members of right-wing extremist groups - find themselves under intensive scrutiny.

They are offered different kinds of counseling or therapy, including meetings with an imam or chaplain while in prison, and outreach programs after their release.

Inmates can still choose to either accept or reject the moderate messages they are given, and some Islamist inmates no doubt will leave prison with the same views, or perhaps with even more extreme ones, officials acknowledged.

Among inmates, there is grumbling about the newly intense scrutiny and skepticism about its effectiveness.

One Hesse inmate, an avowed admirer of former Qaida leader Osama Bin Laden, said he was harassed by prison officials after leading a prayer group inside the prison. The inmate, who identified himself by his nom de guerre Abu Shaheed, was convicted of robbery in 2014, a crime he acknowledges was part of a foiled attempt to obtain money for a move to Syria to join Daesh. The inmate was interviewed with permission of prison authorities.

"My mistake was not asking the officer beforehand," he said about the prayer group. "Then an officer arrived and said I should stop. I was almost done, and others said to him that he should wait. But he'd already pressed the alarm buzzer. Beep, beep, beep."

Several officers then scuffled with him in a corridor, injuring his shoulder, he said.

Abu Shaheed said he opposes violence and thinks his decision to join Daesh was a mistake. But he clings to the same ideology, now infused with anger about what happened to him after the prayer meeting.

"They put me in the special lockup, the entire night and the next day," he said. "For what? Because I wanted to pray?"

No guarantees of success

Will either of the approaches make a difference? Across Europe, criminal justice officials acknowledge that they are seeking to engineer solutions to a problem for which there is scant scientific data, and no guarantees of success. What is known is that previous approaches failed, disastrously. And the scale of the problem in recent years has only gotten worse.

Since the founding of Daesh in 2014, several of Europe's biggest terrorist attacks were led by former prison inmates, some of whom became radicalized while behind bars.

Abdelhamid Abaaoud, the leader of the deadly attacks on Paris in November 2015, grew up in an immigrant neighborhood in central Brussels and was jailed multiple times for assault, burglary and receiving stolen goods. In prison, the onetime street hustler and partyer became an acolyte of an older inmate, an Islamist who the prisoners dubbed "Papa Noel" because of his bushy gray beard. Abaaoud adopted the older man's religious dogma and, after his release from prison, left for Syria to join the terrorists.

Months later, some of Abaaoud's Belgian friends and former prison mates would participate in the March 2016 attack on the Brussels airport, the act that awakened Belgians to the scale of the country's Islamist problem. 

Since then, returnees from Iraq and Syria have been systematically arrested and put behind bars.

The number of arrests related to "jihadist terrorism" continues to climb, from 395 in 2014, to 705 last year, according to statics released in June by Europol.