In late October 2014, the FBI received an unusual email from a young man named Mohimanul Alam Bhuiya.

Bhuiya, then 25, had joined the Islamic State. Now the longtime Brooklyn resident was desperate and looking for a way out. He wanted the FBI to rescue him.

“I am an American who’s trying to get back home from Syria,” he wrote in his email, according to federal court documents unsealed last month. “I just want to get back home. All I want is this extraction, complete exoneration thereafter, and have everything back to normal with me and my family.”

He added: “I am fed up with this evil.”

The Washington Post gives an insider’s look at the Islamic State’s propaganda machine and its influence throughout the world. (Jason Aldag/The Washington Post)

The FBI was still verifying his identity when Bhuiya managed to escape about a week later. He returned to the United States, where he was promptly arrested and charged with providing material support and receiving military training from the Islamic State.

In a closed courtroom in Brooklyn, he pleaded guilty to both counts on Nov. 26, 2014, according to the court filings. He faces up to 25 years in prison.

[Read the criminal complaint against Bhuiya]

Bhuiya’s name is redacted in the documents, but several U.S. law enforcement officials confirmed his identity. His lawyer did not return a message, and efforts to reach his family were unsuccessful.

Prosecutors told the judge that redacting his name was “necessary to protect the integrity of the ongoing government investigations and the safety of the defendant and his family.” But NBC News in May ran an interview with Bhuiya, with cooperation from the Justice Department, in which he appeared under the name “Mo” with his face completely unobscured.

A spokeswoman for the U.S. attorney’s office in Brooklyn declined to comment.

Bhuiya was not your average wayward Islamic State recruit. Unlike many of the people the Justice Department has charged in connection with the terrorist group, Bhuiya appeared to have a bright future. He attended Columbia University before he fell under the sway of the Islamic State.

“A young man from an Ivy League school challenges the conventional wisdom of a typical American ISIS recruit,” said Seamus Hughes, the deputy director at the program on extremism at George Washington University’s Center for Cyber & Homeland Security and a former National Counterterrorism Center staffer.

Bhuiya went to high school in Brooklyn. He seemed to be a well-adjusted student who took a serious interest in Albert Einstein and Thomas Edison, according to a 2008 essay he wrote for the school newspaper entitled “Sample College Essay: My Superhero.”

He praised President Franklin D. Roosevelt and Winston Churchill, who “fought a worldwide battle against the evil supervillain Adolf Hitler.”

In the essay, he said he wanted to major in psychology. He concluded: “I believe that I have greatness in me,” he wrote. “I want to be a superhero.”

According to a Columbia University spokesman, Bhuiya attended the School of General Studies. He was enrolled for one semester from January to May 2013 and did not earn a degree.

Bhuiya had come to the attention of the FBI before he traveled to Syria. According to court documents, investigators with the FBI-led Joint Terrorism Task Force in New York learned in June 2014 that the young man might be planning to travel to Syria.

When authorities interviewed Bhuiya at his home in Brooklyn, he told investigators that he was interested in events in Syria and supported “rebel groups.” But he claimed he lacked the money to travel to Syria and “did not know what he would do if he got there.”

Days later, he flew to Istanbul and then managed to enter Syria. He had little interest in fighting.

He implored Islamic State commanders not to “send me off to the front lines because I can be useful in other ways,” according to the NBC interview. “It seemed to me that it would, you know, save my skin.”

Bhuiya said he quickly became disillusioned and described the Islamic State as “dystopia.”

“You could see madness in their eyes,” he recalled. Bhuiya decided to flee. In the email to the FBI, he said he did not have a passport because the Islamic State had taken it. He asked if someone could pick him up at the border.

“Please help me get home,” he told the FBI.

According to court documents, Bhuiya managed to escape across the border into Turkey and make his way to a U.S. State Department outpost in Adana, which is in the southern part of the country.

He admitted that he had joined and worked for the Islamic State. He said he carried a weapon but had never been involved in fighting.

It is not clear where Bhuiya is being held as he awaits sentencing.

Court documents indicate that prosecutors, at Bhuiya’s request, had been exploring the possibility of going public with his story.