On a rainy morning, Imran Rabbani returned to the Essex County Juvenile Detention Center so he could reunite with his former keepers.

Four years before, Rabbani had arrived at the facility in shackles after being swept up in an Islamic State-inspired plot to set off a pressure-cooker bomb in New York. He was 17.

Now, just starting his thirdsemester at New York University, the 22-year-old Rabbani wanted to give thanks to the people who guided him away from Islamist extremism. As he waited in the library last summer, glancing at books that had proved crucial to his transformation, the room slowly filled with city officials, staff and guards. Rabbani spotted Capt. Robert Woodson and leaned in for a hug. After they embraced, Rabbani began sharing memories. The room quickly fell silent as people fixed their eyes on the pair.

“Remember how you’d allow me and other inmates to eat snacks while we watched ‘The Wire’ inside the library? And that other time you allowed me to pray in private and then call my mom?” Rabbani asked.

“I remember,” Woodson replied. “You and the other inmates were like my children. I love all of you.”

Rabbani placed his hand on Woodson’s shoulder as tears fell down both their faces.

“I never expected a prison guard, let alone a captain, to treat me like that and with kindness,” he said.

Looking back on his time in custody, Rabbani now sees that kindness and education as the keys to what friends, family and law enforcement say was an unexpected transformation — a change that ultimately helped deepen and enrich his identity as an American Muslim.

b

The son of Pakistani immigrants,Rabbani struggled to fit in while growing up in New York. He felt like an outsider, never fully identifying as American or Pakistani.

Stress was the common denominator in Rabbani’s life. Money was always tight, and Rabbani, his parents and three siblings squeezed into a one-bedroom apartment in Flushing. When Rabbani finally made friends, his father disapproved of them and urged him to abide by more conservative Pakistani traditions.

As he searched for answers, Rabbani met Munther Omar Saleh, who was three years older and lived a few buildings away.

It was 2015 and a U.S.-led coalition was beginning to conduct airstrikes against Islamic State, also known as ISIS, after it took control of large swaths of Syria and Iraq. Federal prosecutors would later allege in court documents that Saleh was researching how to build a bomb to carry out a terrorist attack.

Rabbani would later say he knew nothing of Saleh’s plans, at least not then. Their friendship deepened and profoundly affected how Rabbani viewed the world.

The charismatic Saleh said Muslims were persecuted by Jews and Christians and suggested that Islamic State was establishing Islam the way the prophet Muhammad intended.

At first, such talk made Rabbani uncomfortable. But after a few months, the alarm going off inside Rabbani’s head slowly faded. For the first time, he would recall years later, Rabbani felt someone accepted him. He didn’t want to lose that feeling of belonging.

In 2015, Rabbani and Saleh were often volunteering at Masjid Al-Falah, a mosque in Queens. Sometimes they spent the night at the mosque, debating different teachings in Islam. They discussed hadiths, written accounts of the prophet Muhammad’s sayings and actions that Muslims use as a source of moral guidance and religious law.

One time, Saleh read a translation of a hadith that he said instructed Muslims to join Islamic State:

“A nation will come from the east with black flags. … If any one of you finds this nation, then you must join them even if you have to crawl over ice,” Rabbani recalled Saleh telling him.

“This isn’t the Islam I know,” Rabbani thought at first.

But Rabbani began reading articles and watching videos produced by Islamic State online, and he continued to turn to Saleh for advice, nicknaming him “Mufti,” a Muslim legal expert.

“I’ve been looking more into it ... we should talk in person,” Rabbani texted Saleh one evening, according to court documents. Islamic State’s ideology, he added, “just makes sense.”

“You mean establishing Islam the same way the Prophet ... did? We can meet up whenever your free,” Saleh replied.

“Yeah and dude it’s like their doing it step by step and perfectly ... the exact ways and rules of the prophet,” Rabbani texted back.

b

Unbeknownst to Rabbani, federal agents had been tracking him and Saleh for months. They listened to Rabbani’s conversations, followed his moves, monitored his internet searches and bank statements.

They learned Saleh was meeting up with four friends in Staten Island, where they discussed Islamic State teachings and possible locations for an attack, such as Times Square. Rabbani said he never attended those meetings and didn’t know Saleh was planning an attack.

In May 2015, Rabbani and some friends were heading to a mosque in Brooklyn when they spotted a car following them. After they arrived at the mosque, Rabbani and his friends approached the vehicle, but before they could challenge the driver, he drove off. Thinking it might have to do with his religious beliefs, Rabbani called 911.

After weeks of being followed, Rabbani grew frustrated. One evening after prayer services, Rabbani, Saleh and another friend were in the friend’s Jeep Cherokee when they noticed they were being tailed. When they came to a stoplight, Rabbani and Saleh got out and ran toward the car to confront the driver. The vehicle reversed and within moments several federal law enforcement cars raced up. When agents searched Rabbani and Saleh, they found knives, according to court documents, and the two were arrested. Rabbani maintains it was normal for him to carry a knife.

Rabbani was charged with conspiring to provide material support to a foreign terrorist organization.

After Rabbani agreed to plead guilty as an adult to one count of conspiracy to interfere with federal officers, the government dismissed the terrorism charges. Saleh later pleaded guilty to conspiring to provide material support to Islamic State and other crimes, and in 2018 was sentenced to 18 years in prison.

When Rabbani arrived at the detention facility in Newark, Capt. Michael Thomas was skeptical. Rabbani was the first prisoner there linked to terrorism; about 95% of the inmates were gang members.

Whatever doubt Thomas had, he kept it to himself. “I’ll show you respect and trust you just like I trust everybody else. We’re going to start a new page in your life,” Thomas remembered telling Rabbani. “This could be a steppingstone for you.”

Though some guards nicknamed him “Baby ISIS,” many treated him with kindness. Federal authorities suggested the staff keep Rabbani in solitary confinement until they were confident he wouldn’t spread Islamic State ideology to other inmates.

Spending hours alone was hard. Most of all, he missed his mother.

He came to find a surrogate mom in Pamela Muhammad, a compliance officer. She once went to the cafeteria and cut off the labels of halal hot dogs and brought them to a skeptical Rabbani to prove they complied with Islamic dietary laws.

Muhammad, who also is Muslim, gave Rabbani a prayer rug. She recalled gently placing her hand on his back and telling him:

“If you need anything, you can count on me. Read the Quran. It will keep you calm because there are things you are still learning.”

b

Rabbani was assigned therapy sessions with Dr. Linda June, who supervises the mental health unit at the facility. They met for 45 minutes twice a week, and to help him pass the time in his cell, June gave Rabbani psychology textbooks and assigned him chapters to read.

Rabbani hated reading but agreed, and to his surprise he developed a passion for psychology.

They discussed various theories, which helped Rabbani better understand himself, such as Carl Rogers’ theory on “unconditional positive regard” — showing complete acceptance and support for a person no matter what they say.

June empathized with Rabbani’s situation, but she also challenged him. When Rabbani returned to the detention center, he recalled her telling him, “It seems like you have a problem with authority.”

Rabbani laughed when he remembered how defensive he became when June told him that. After he had returned to his cell, though, he realized she was right.

Books soon began to pile up in his cell. He had many favorites, among them “The Alchemist,” “City of Thieves” and “The Autobiography of Malcolm X.” Inmates were usually allowed to check out only a few books at a time, but Muhammad urged Capt. Thomas to make an exception. He agreed and told the guards not to touch his books.

One important lesson Rabbani said he learned from his reading was that people are more likely to use violence if they are surrounded by it.

b

After spending six months in solitary confinement, Rabbani was permitted into general population. It was November 2015, and by then many of the staff were helping him in small ways.

One prison guard replaced Rabbani’s old slippers with a new pair. Another gave him a hug and wished him luck every time he headed to court.

Lawrence Outlaw, a recreational officer, taught Rabbani how he could better manage tumultuous relationships through chess. “Just like when you play chess, you have to be patient in life and think three steps ahead,” Outlaw said he recalls telling Rabbani. “You can’t be so aggressive.”

Rabbani also found a father figure in Manazir Ahmed, a Pakistani math teacher at the detention facility who sometimes led Friday prayer for Muslim inmates.

One day, Ahmed called Rabbani into his classroom and handed him a small Quran. He pointed out a comforting passage people often recite when facing difficulties and urged Rabbani to read it out loud three times. After he finished, Ahmed reached for Rabbani’s hand, gripped it firmly and told him in Urdu:

“You’re like my son. Don’t listen to the bad things people say. Just keep praying.”

He let go of Rabbani’s hand and told him to keep the Quran.

Rabbani took Ahmed’s advice, and while alone in his cell highlighted passages in the Quran that resonated with him. One line became his driving principle for embracing tolerance and pluralistic views of thought: “To you be your way, and to me mine.”

He also started attending Jewish and Christian prayer sessions to learn about different faiths. In time, Islamic State’s teachings seemed ridiculous, a political ideology that did not reflect the faith, he says now.

Bolstered by his newfound passion for psychology and renewed relationship with Islam, he began to find, for the first time, his own voice.

The young man who nearly failed his senior year in high school earned straight A’s in college courses he took at the detention facility. He began to wonder about his future, and one night in his cell, he took out a piece of paper from his notebook and titled it “When I Leave.” He jotted down his goals, among them:

“Work toward bachelor’s and master’s degree. It’s going to take a lot out of you, but push yourself.”

b

Just as Rabbani’s conviction in Islamist tenets developed over time, his turning aside from the extremes of Islamism unfolded gradually as well. There was no epiphany. He wasn’t sent to a special program to reform Islamic State sympathizers.

Experts who study terrorism say his case offers a lesson for law enforcement. Though the U.S. government has devoted resources to preventing terrorism, it has no clear strategy on how to help individuals who are susceptible to violent extremist ideologies.

“We know the push and pull factors when it comes to someone who is becoming radicalized, but we understand much less about how they get out of that mind-set,” said Bennett Clifford, a research fellow at George Washington University’s program on extremism.

“Sending someone to prison is a temporary solution. And we don’t know if prison serves as an effective deterrent.” Finding answers is becoming increasingly more urgent. Within the next few years, two types of terrorist offenders will be released from federal prison, Clifford said.

The first group includes people arrested for establishing connections with Al Qaeda or the Taliban in the early 2000s.

The second group includes people who were arrested within the last six years after being investigated for providing material support to groups such as Islamic State but were ultimately charged, like Rabbani, with smaller violations and are serving shorter sentences.

“There are people who are going to come out of prison after serving 18 years and they haven’t received the type of help and support that they need,” Rabbani said.

Communities worldwide have been piloting a variety of programs aimed at preventing and de-radicalizing violent extremists, with mixed results, Clifford said. Its effectiveness is still up for debate, he said, because of a lack of data.

A program called Countering Violent Extremism, founded in 2011 by the Obama administration, aimed to assist individuals who were on the path toward extremism and before they became violent. The program upset civil rights groups, who say it unfairly targeted Muslims and ignored others, such as white supremacists.

There are two other federal programs still in the development phase, Clifford said.

One such effort, called DEEP, or Disruption and Early Engagement Project, was started in 2016 by the U.S. attorney’s office for the Eastern District of New York and is meant for certain individuals prosecuted on terrorism charges. Specialists work one-on-one with the person, while evaluating their potential for violence.

b

In November 2016, several months after turning 19, Rabbani was released from the detention center after serving 14 months. Since then, he has been working toward mending his past.

When he’s not in class pursuing a bachelor’s degree in political science and psychology, he’s a chef at a halal burger joint in Manhattan. He wants to go to law school.

Friends, family and co-workers say Rabbani has matured into a calm and assertive young man with a strong work ethic. But mostly they are impressed with his thirst to learn about different worldviews. Law enforcement officials echoed similar sentiments about Rabbani and noticed a newfound confidence, sensitivity and kindness.

Rabbani’s journey taught him not to trust people so easily, and he’s come to lean on his brothers for advice. But at times his past catches up with him and he finds himself struggling with anxiety when he recalls the terrorism charges. “I was clearly going through an identity crisis, and if it wasn’t for the people I met, I don’t know what path I would have gone down.”

After spending the day catching up with his former keepers, Rabbani walked toward the exit at the detention center. About 10 feet from the door, he turned to Thomas and Woodson, shook their hands, gave them a hug and said goodbye. It was the first time he’d be leaving the detention center free of shackles on his ankles and wrists. Thomas and Woodson stood still as they watched him leave.

Rabbani turned around to watch the gates close behind him. He walked across the street, sat on the pavement and cried, gripping the Quran that Ahmed had given him.