A citizen of Bangladesh who was living in Maryland has been charged with attempting to provide material support and resources to the Islamic State group.

A court document says that 24-year-old Nelash Mohamed Das of Hyattsville was ready to carry out what he thought was an attack on a member of the U.S. military when he was arrested Friday. The supposed attack was set up by a confidential informant for the FBI.

Das, a legal permanent resident of the United States, made his first appearance in federal court Monday. He has been ordered held until a detention hearing Thursday. Online court records did not list an attorney for him, though a spokeswoman for the United States Attorney for the District of Maryland said Das had been assigned a public defender. An attempt by The Associated Press to reach the attorney Monday evening by phone for comment was unsuccessful.

If convicted, Das faces a maximum sentence of 20 years in prison.

Das voiced support on his social media accounts for the Islamic State group from late 2015 to early 2016, including support for attacks in Paris and San Bernardino, California, and had taken a class and submitted fingerprints in order to get a handgun permit, according to court documents filed in his case. He told a confidential informant for the FBI that he wanted to kill U.S military personnel, the court documents say.

Conducting an attack is "like my goal in life," Das allegedly told the informant.

Das met the FBI's confidential informant in May 2016 and thought he was a like-minded supporter of the Islamic State group, the court documents say.

The confidential informant told Das he had gotten information about a target, member of the U.S. military, from an Islamic State group contact in Iraq. Das allegedly said he wanted to help carry out an attack on the person and bought ammunition for it. Das believed that the confidential informant's contact in Iraq would pay $80,000 in exchange for the attack, the court documents say.

Das was arrested after loading a gun and traveling with the informant to a location where he believed they would conduct the attack, the court documents say.