Updated

A California man was charged with trying to join a terrorist group active in Syria after he expressed his love for the head of the group and tried to board a flight to the region, authorities said.

Adam Shafi, 22, of Fremont, California, pleaded not guilty Thursday to one count of attempting to provide material support or resources to a designated foreign terrorist organization, according to court records.

Shafi in telephone calls with friends earlier this year expressed his love for the head of the terrorist group, al-Nusra Front, and said he was content dying with the group, according to an FBI affidavit in the case. The indictment against Shafi was unsealed on Thursday.

Authorities were alerted to Shafi after his father reported him missing in August 2014 to the U.S. Embassy in Cairo during a family trip to Egypt and said his son may have been following extremist Islamic leaders online, according to the affidavit by FBI Special Agent Christopher Monika.

Shafi returned to his family and the United States, and the FBI put him under surveillance after learning he and a friend had traveled to Turkey, a common point of entry for foreign fighters trying to get into Syria, according to the FBI.

Shafi was stopped on June 30 at San Francisco International Airport just as he was about to board a flight to Turkey. He told FBI agents that he was a web developer who no longer wanted to live in the United States, but he denied he was going to Turkey to cross into Syria to join a terrorist group, according to the affidavit. He was arrested a few days later and indicted by a grand jury earlier this month.

No one answered at a phone listing for Shafi, who was in custody.

Shafi's attorneys, Joshua Dratel and Erik Levin, said in a statement that Shafi wanted to help Syrian refugees and had no violent or criminal intentions. "He told the agents more than once that he was not flying to Istanbul to join any terrorist organization, and there's no evidence to the contrary," they said.

Shafi's case has no connection to the Dec. 2 attack in San Bernardino, California.