With 2,500 inmates, the penitentiary institution of Fresnes, about 20 miles south of Paris, is one of the largest prisons in Europe. Like most French prisons, Fresnes is overcrowded. Built in the late 19th century, its tiny cells, each meant for one prisoner, most often house three.

Inmates scream curses and catcalls from their barred windows as I visit a small, empty sports yard ensconced between cell blocks. Plastic bags and punctured soccer balls are caught in the surrounding concertina wire.

The prisoners here yelled out in just this way back in November 2015, refusing to honor a minute of silence for the victims of the terrorist attacks on Paris cafes and the Bataclan concert hall.

Fresnes prison director Philippe Obligis says he began to see a radicalization problem here well before those attacks took place.

"There were some radical Muslims who were putting huge pressure on regular Muslims to adopt a certain kind of behavior," he says. "Like taking a shower with their clothes on and not listening to music or watching TV."

Many of the homegrown terrorists who've launched attacks in recent years in places like Paris and Brussels were radicalized in prison — often while serving jail terms that had nothing to do with terrorism. In France, where a disproportionate number of prison inmates are of Muslim background, authorities are struggling to deal with the phenomenon.

In 2014, Fresnes became the first French prison to separate radicalized inmates from the general prison population — they were put in an entirely separate wing, one person to each cell, and had different guards from the other prisoners.

After 2015, which began with the January attacks at the satirical magazine Charlie Hebdo and a Kosher supermarket, and ended with the Bataclan attack in November, some other French prisons began separating inmates too. Several of the terrorists who killed nearly 150 people that year were common criminals who had become radicalized in prison.

In 2016, the French government put money into a rehabilitation program for radicals deemed not too far gone. The prisoners in these new anti-radicalization units received visits from psychologists and historians; they had the chance to attend some workshops or receive some training.

The radical units were controversial, especially after two guards at one prison were attacked in September of last year. In November, the French interior minister announced an end to the program.

Instead, the French government boosted security around the most dangerous prisoners — both radicals and not. And intelligence collecting in prisons was beefed up. A bureau of central intelligence for prisons was created earlier this year.

Around 350 French prisoners are serving jail terms for terrorist-related offenses. And a further 1,340 inmates convicted of regular crimes are identified as radicalized.

"They'll contaminate the others"

Businessman Pierre Botton went to jail for white collar crime in the 1990s and founded Together Against Recidivism, an organization devoted to improving the lives of prisoners. He says it's nearly impossible to think about reforming in jail because prisoners are mainly just struggling to survive.

He believes radicals should be separated in different prisons entirely, because otherwise, they'll inevitably interact with the rest of the prison population. He notes what happened when the only surviving terrorist from the Paris Bataclan attacks landed in a French jail last year.

"When Salah Abdeslam arrived, they clapped," says Botton. "Do you understand what I'm saying? When he arrived in the jail, they clapped. They applauded."

Botton says criminals like Abdeslam are icons in jails in the Paris region, where up to 70 percent of inmates identify as Muslim. Keeping records on the religion and ethnicity of French citizens is illegal, so there are no official statistics. But Botton says about 70 percent of prisoners in the Paris region observe the Muslim festival of Ramadan.

"So when you put guys like this who represent a certain ideology in the heart of a prison, surrounded by 4,000 inmates, there's a huge risk they'll contaminate the others," he says.

Yannis Warrach, a Muslim cleric who works in his spare time at a top-security prison in Normandy, says prison is so brutal, inmates can only survive if they're part of a gang. He has seen how the radicals recruit newcomers.

"The ones who preach and proselytize will at first be nice to a detainee. They see his desperation," he says. "They'll befriend him, give him what he needs. Then they'll say it's destiny. They'll say that God has a mission for him. And little by little, they brainwash him, telling him French society has rejected him, he can't get a job because of his Arab last name, and he was always put in the worst classes at school.

"The problem is," says Warrach, "it's often true."

Warrach says these young men must have hope for a different future to break out of the spiral of failure. He says French leaders have failed to change the socioeconomic factors that keep many French people of Muslim descent on the bottom rungs of the ladder.

Another big problem, he says, is the prevalence of hard-line, Salafist reading material in jails — often French translations of Saudi, Wahhabist tracts that advocate literal, strict interpretation of religious doctrine.

"I work to debunk this stuff," says Warrach. "I give inmates under pressure a historical context of the faith and another narrative of Islam."

He says that because of the pressure from radicals, who consider him an agent of the French government, he has to meet secretly with inmates who desperately want his help. Instead of meeting in rooms designated for religious worship, which are open, they meet in special prison visiting rooms for inmates' lawyers, where no one can observe them.

Because of its strict separation of religion and state, Warrach says France is the only country in Europe where being a prison cleric is not considered a profession. He says he only receives a small stipend, but that he can't build a life around it — there are no retirement plans or other benefits. Because of this, there can't be an imam at the prison every day, which creates a huge void, he says. And it leaves plenty of room for uninformed, extremist interpretations of Islam in French prisons.

Copyright 2018 NPR. To see more, visit http://www.npr.org/.

LULU GARCIA-NAVARRO, HOST:

We now get a rare look inside a French prison. Officials in France say prisons have become incubators of extremism. Many of the homegrown terrorists who've launched attacks in places like Paris and Brussels recently were radicalized while incarcerated, often while serving jail terms that had nothing to do with terrorism at all. NPR's Eleanor Beardsley reports.

ELEANOR BEARDSLEY, BYLINE: I'm escorted into Fresnes, one of the largest prisons in Europe, about 20 miles south of Paris. Like most French prisons, Fresnes is overcrowded. There are often three prisoners to tiny cells built for one plus bed bugs and rats.

(SOUNDBITE OF CATCALLS)

BEARDSLEY: Inmates yell out curses and cat calls from behind their barred windows as I visit a small, empty sports-yard ensconced between the cellblocks. There are plastic bags and punctured soccer balls caught in the surrounding concertina wire. Inmates here yelled out this way in November 2015, refusing to honor a minute of silence for the victims of the terrorist attacks on Paris cafes and the Bataclan Concert Hall. Fresnes prison director Philippe Obligis says he began to see a radicalization problem well before those attacks.

PHILIPPE OBLIGIS: (Through interpreter) There were some radical Muslims who were putting huge pressure on regular Muslims to adopt a certain behavior like taking a shower with clothes on and not listening to music or watching TV.

BEARDSLEY: In 2014, Fresnes became the first French prison to separate suspected radicalized inmates from the general prison population. After the major terrorist attacks of 2015, some other prisons did the same thing. Some of those terrorists who had targeted journalists at satirical weekly Charlie Hebdo, shoppers at a kosher supermarket and concert-goers in Paris had gone into prison as regular criminals and come out radicalized.

The French government even put money into rehabilitation in the radicalized units, counseling and workshops for those deemed not too far gone. Businessman Pierre Botton went to jail in the 1990s and now runs an organization devoted to improving the lives of prisoners. He thinks radicals should be separated in different prisons entirely because they'll inevitably interact. Botton notes what happened when the only surviving terrorist from the Bataclan attacks, Salah Abdeslam arrived in a prison last year.

PIERRE BOTTON: When Salah Abdeslam arrives, they clap. You understand what I say? When he arrives into jail, they applaud.

BEARDSLEY: Botton says guys like Abdeslam are icons in Paris-region jails, where up to 70 percent of inmates identify as Muslim. He switches to French.

BOTTON: (Through interpreter) So when you put guys like this who represent a certain ideology in the heart of a prison surrounded by 4,000 inmates, there's a huge risk they'll contaminate the others.

BEARDSLEY: Yannis Warrach serves as an imam at another top-security prison in Normandy. He says having radicals alongside regular prisoners is a big problem. But grouping them all together is, too. For him, there are no easy answers. Prison is so brutal, inmates can only survive if they're part of a gang. Warrach sees how the radicals prey on newcomers.

YANNIS WARRACH: (Through interpreter) The ones who preach and proselytize will at first be nice to a detainee. They see his desperation. They'll befriend him, give them what he needs. Then they'll say it's destiny. They'll say that God has a mission for him. And, little by little, they brainwash him, telling him French society has rejected him. He can't get a job because of his Arab name, and he was always put in the worst class at school. The problem is this is often true.

BEARDSLEY: Warrach says another big problem is the prevalence in prison of hardline Salafist reading material that he says discourages Muslims from integrating in their own countries.

WARRACH: (Through interpreter) The prisoners I counsel have a lot of questions about Islam because they don't know much. I try to debunk this extremist literature and give them another narrative entirely.

BEARDSLEY: But Warrach says the radicals consider him an agent of the French state. So he has to meet secretly and hide his sessions with the inmates who so desperately want his help. Eleanor Beardsley, NPR News, Paris. Transcript provided by NPR, Copyright NPR.