SAN FRANCISCO (CBS SF) — A Fremont man suspected of attempting to travel to Syria to join a branch of Al-Qaeda was denied bail by a federal judge Tuesday.

22-year-old Adam Shafi was detained as he tried to board a flight to Istanbul in June.   A federal judge in San Francisco deemed Shafi a flight risk, and denied bail, the Contra Costa Times reported.

READ MORE: Thieves Target License Plates in San Francisco; Rack Up Parking Tickets

Shafi grabbed the attention of federal investigators in 2014 when he disappeared from a family trip in Cairo, according to an affidavit filed by an FBI agent.

When his father reported him missing, he said he was afraid that his son had been recruited and may have traveled to Syria, Iraq or Gaza and joined a violent extremist movement, according to Monika.

Shafi surfaced a few days later and said he had been in Istanbul.  When questioned by FBI agents, he said he was trying to provide assistanceto Syrian refugees. He didn’t tell his family because they wouldn’t have let him go, Monika said.

After finding Shafi had contact with possible extremists, the FBI started surveillance on him later that year.

READ MORE: Dr. Martin Luther King Jr.'s 'I Have A Dream' Speech Remains Impactful Decades Later; 'Thank God Almighty, We Are Free At Last'

The following June, investigators intercepted phone calls of him expressing admiration for al-Nusrah Front and a willingness to fight and die for the group. He said he was raising money to travel to Syria to join them, according to Monika.

On June 16, Shafi told a friend on the phone in a recorded conversation, “I just hope Allah doesn’t take my soul until I have at least, like, a couple gallons of blood that I’ve spilled for him. At least, something like that… I just really hope so. How can I meet Allah when my face has no scars on it…”

Over the next two weeks, investigators learned he was planning to travel to Syria and intercepted him before he boarded a flight to Istanbul.

Shafi was indicted by a federal grand jury for one count of attempting to providing material support or resources to a designated terrorist organization.


MORE NEWS: San Francisco Library Receives $2M To Expand Services For Incarcerated