Stephane Medot spent 10 years in Belgian prisons for bank robbery and got a front row seat on the radicalization of Muslim detainees. (Steven Mufson/The Washington Post)

Stephane Medot knows a thing or two about Belgian prisons. He spent 10 years in them. Arrested for carrying out more than a dozen armed bank robberies, the stocky, bald-headed Medot moved from prison to prison, from one cell of his own to another, until he served out his time.

Along the way, he got a front-row seat in a prison system that has become a breeding ground for violent Muslim extremists. Many of those involved in the Paris and Brussels attacks first did short stints behind bars for relatively petty crimes. And there these wayward young people met proselytizers and appear to have acquired a new, lethal sense of purpose.

A Belgian prison is where Abdelhamid Abaaoud, who helped plan the Paris attacks and who was killed in a police raid in November, met Salah Abdeslam, an alleged Paris attacker who was captured in Brussels this month. Salah’s brother Brahim, who blew himself up in Paris, also served time.

[Probe into Brussels bombings expands across Europe]

Two of the suicide bombers in the Brussels attacks last week, brothers Ibrahim and Khalid el-Bakraoui, had spent time in Belgian prisons for violent offenses that included armed robbery and carjacking.

1 of 28 Full Screen Autoplay Close Skip Ad × Photos: Scenes from Brussels after deadly blasts at airport and metro station View Photos More than a dozen people were killed, and several others were injured, after explosions at an airport and metro station in the Belgian capital. Caption More than a dozen people were killed, and several others were injured, after explosions at an airport and metro station in the Belgian capital. March 22, 2016 An image from a security camera shows three suspects of the attacks at Brussels Airport, in Zaventem, pushing trollies with suitcases. The Belgian federal prosecutor confirmed, April 9, that Mohamed Abrini, right, who was arrested in connection to the attacks in Paris on Nov. 13, 2015, was the “man in the hat” captured in surveillance footage at the airport on March 22. Belgian Federal Police/AP Buy Photo Wait 1 second to continue.

Medot, now 37, said that from prison to prison, the routine he witnessed was similar. Proselytizing prisoners used exercise hours and small windows in their cells to swap news, copies of the Koran and small favors such as illicit cellphones. Gradually, they won over impressionable youths and taught them to stop drinking and start thinking about perceived injustices such as the invasion of Iraq, the plight of Palestinians or the treatment of their own immigrant families.

The prison guards, who could not understand Arabic, had a “laissez-faire attitude,” he said, and did nothing to stop the pulsating music or political discussions.

“If you’re not a Muslim, you feel the need to adapt to the rules,” said Medot, who is not Muslim. When the hour for prayer arrived, everyone was asked to turn off televisions so as not to disturb the faithful.

For the past year, Belgium’s Ministry of Justice has been planning to change a prison system widely seen as a school for radicals. It is creating two isolated areas, each with room for 20 people, at Hasselt and Ittre prisons for the most radical inmates. At the moment, said ministry spokeswoman Sieghild Lacoere, only five inmates clearly qualify. The segregation is set to begin April 11.

“The best solution for fighting the process of radicalization,” the ministry said in its action plan last year before the Paris and Brussels attacks, is “one part isolation by concentration, completely isolating the radical individuals from the other detainees to avoid a great contamination” and prevent them from “feeding other detainees more of their ideology.”

The ministry also said it would improve living conditions in the overcrowded prisons. Belgium has about 11,000 prisoners, ­Lacoere said, of whom 20 to 30 percent are Muslims, even though Muslims make up only about 6 percent of the population.

France, with Europe’s largest Muslim population, is facing similar problems. It, too, has opened special units, manned by psychologists, historians and sociologists, for potentially violent extremists at five prisons. A year ago it vowed to hire 60 more Muslim chaplains.

[French prisons, hotbeds of radical Islam, get new scrutiny after Paris attacks]

Medot said that changing the culture of prison is difficult. He said that youths “arrive alone, feel alone” and that the older Muslim inmates “attract guys who want to become fuller members of the group.”

Medot was in prison when terrorists attacked London, Madrid and a Jewish school in Toulouse, France. He said many prisoners celebrated what their “brothers” did. Medot said that when discussing the Sept. 11, 2001, attacks on the United States, many would say that “Americans stole the [Middle East’s] oil and that this is revenge and this is just.”

For several months, Medot said, he overlapped with Nizar Trabelsi, a professional soccer player turned al-Qaeda follower who confessed in 2003 to an aborted plot to drive a car packed with explosives into Kleine Brogel, a NATO air base in Belgium where U.S. nuclear missiles are thought to be stored. Trabelsi served 10 years in Belgium and then was extradited to the United States, despite condemnation from the European Court of Human Rights.

“He was one of the guys who was seen as a hero,” Medot said. In prison in Belgium, Trabelsi, a Tunisian, taught Arabic by passing books through the cells’ small windows. Though Medot, considered a flight risk, had his own cell, others stayed in cells with two to five people. Trabelsi also played loud Koranic music and prayers from his cell, as well as recordings of bullets and shooting. The guards did nothing except occasionally ask that he turn down the volume.

“The parents will come and visit, and the detainee will say he wants books, wants to find religion and change his ways,” Medot said, “and parents see that as positive, to take a path away from petty crime, away from drugs, away from alcohol. And they don’t know what is happening on the inside.”

[Security forces missed chances before the Brussels attacks]

But Medot said that the government’s plan to isolate radicals won’t work. Who will decide which prisoners are too radical to stay with other detainees? Won’t they become even more radical in isolation? And what will happen to them when their sentences run out?

Lacoere said the Justice Ministry’s plan includes hiring more experts to “de-radicalize” inmates. She said guards will get special training. She said isolating the radicals isn’t the same as abandoning them; they will get more intensive attention, she said.

Still, she acknowledged, there will be difficult issues. “There is not a lot of knowledge in the academic world on this de-

radicalization. It’s a very hard topic to talk about,” she said. “It’s about influencing people’s ideas, and there’s freedom of speech and thought in our country.”

Salmi Hedi, a Tunisian-born imam, has worked in the Belgian prison system for nearly 20 years trying to de-radicalize inmates. He said Belgium’s 18 penitentiaries share just eight imams and one woman religious counselor. The Justice Ministry has promised 11 more.

He disagrees with the government’s diagnosis and concern about “contamination” by radicals.

“Are they viruses? It is not a constructive view,” Hedi said. “It is very dangerous. If you put these people together, you cannot control them anymore. They will feel stronger.”

Asked whether prison changes prisoners, Hedi responded, “Are they transformed, or have they been like that and waiting to show themselves?”

He said the petty criminals come out of prison without any job skills. They are looking for a source of confidence, he said, adding that “the only way to find that was religion.”

Hedi said his office has no desk, so he sits on the floor to talk to prisoners, and listens. His goal: “To get people to think. To ask: Did you get your own convictions or did you follow others like sheep?”

Now that Medot is out of prison, he has become part of a growing number of Belgians trying to connect with young Muslims to keep them from entering a life of crime, and if they do go to prison to prevent them from becoming radicalized. He usually works with schools.

“I like to surprise them,” said Medot, who wears ties to classes before telling students that he and four friends wielding pistols and Kalashnikov rifles stole hundreds of millions of euros. He traveled, bought fancy cars. After being arrested he escaped but started robbing banks again. Then he was rearrested. That usually gets the students’ attention.

“These young guys are not afraid of prison. They have friends or relatives who come out and say that it was like a hotel,” Medot said. “This is where I come in. I tell about the reality. Why would people fight for parole, try to escape? Why are there so many suicides? Why do people start to take drugs, not just illegal drugs but legal ones, because they’re not functioning properly anymore?”

He said students often betray a respect for him.

“I say that there are two words you hear in prison: hatred and respect,” Medot said. “Those are two words I don’t want to hear anymore.”

Medot said he was arrested because of carelessness. Robbing banks was surprisingly easy, but a drunken boast at a bar overheard by a police informer, a careless visit home by one of his gang, and it was over.

Asked how much money he lost, he said, “Mainly, I lost my freedom. Ten years of my life.”

Annabell Van den Berghe contributed to this report.

Read more:

How two brothers became suspected members of the Paris terror plot

French prisons, long hotbeds of radical Islam, get new scrutiny after Paris attacks

Three lives that changed on the day that terror came home to Belgium

New Islamic State recruits have deep criminal roots