A Virginia man believed to be the first American charged with ISIS-related crimes who was captured on the battlefield appeared in front of a U.S. judge Thursday.

The judge unsealed charges against Mohamad Khweis, 26, alleging the Alexandria man provided material support to terrorists and agreed to be a suicide bomber for them. But he apparently lost his motivation quickly, telling Kurdish media it was "very, very hard" to live in the war zone.

Khweis appeared in U.S. District Court for the Eastern District of Virginia with a shaved head and threw a wave to relatives who were seated in the front row. He said little during the five-minute hearing; he was ordered held pending a detention hearing scheduled for Tuesday.

Thursday's hearing marked the first time his family had seen him since he left for Istanbul and eventually ISIS territory back in December 2015. Relatives were visibly happy to see him.

Kurdish forces captured the suspect in northern Iraq in March, two months after he joined ISIS, according to investigators. Khweis told Kurdish television he became disenchanted with life there and made his way to the front lines to surrender, where he renounced the organization's ideology.

If convicted, Khweis faces a maximum sentence of 20 years in prison, a $250,000 fine and a lifetime of supervised release. He would be the sixth person convicted by jury in an ISIS-related case.

Khweis's attorney, John Zwerling, told reporters it was too early to determine how his client would plead. Zwerling said he met with Khweis for about one hour this morning prior to the hearing. He added that his client was transported to the U.S. yesterday from Irbil where Iraqi authorities were holding him.

FBI agents questioned Khweis while he was in Iraqi custody.

An FBI affidavit filed last month and unsealed Thursday states that an ISIS member asked Khweis whether he was willing to serve as a suicide bomber. Khweis said he agreed, but he told U.S. authorities that he believed the question was a test of his loyalty.

According to the affidavit, Khweis received training in Islamic law during his time there, but the affidavit made no mention of military training. Khweis told investigators that the only time he touched a gun in his time there was to move it off a couch so he could sit down.

Khweis told the FBI he developed an interest in joining ISIS in mid-2015, and that he left in December from Baltimore-Washington International Thurgood Marshall Airport to Turkey in December 2015, according to the affidavit. He sold his car before departing.

From Turkey, he made contact with ISIS facilitators who smuggled him and others into Syria, and stayed in ISIS safe houses in the Syrian city of Raqqa during the month of January, according to the affidavit.

At one of the safe houses, ISIS officials said the recruits would be trained to return to their home countries and conduct attacks on behalf of ISIS, according to the affidavit. Khweis told investigators he never agreed to participate is such an operation.

The affidavit states that Khweis received the majority of his religious training in the Iraqi city of Mosul, which is controlled by the Islamic State. The imam in those lessons ended every session by saying "May God destroy America," according to the affidavit.

According to the affidavit, Khweis admitted burning his laptop and destroying two mobile phones before surrendering to the Kurds.

Khweis' attorney, John Zwerling, said after Thursday's hearing that he was not able to comment on specifics of the case and that he had only briefly met with Khweis to discuss it. Asked if there is a legal distinction between moving to ISIS territory to live there as opposed to actively taking up arms to fight on its behalf, he said the distinction is an important one.

Merely living there "may get you indicted but may not get you convicted," he said. "Mosul is Mosul. A lot of people live there."

He also cautioned that the government's narrative in the FBI affidavit is its interpretation of his remarks.

"Everything is not as it appears in the government's pleading," he said.

Fox News' Matt Dean, Courtney Stein Vargas and The Associated Press contributed to this report.