A former National Guard soldier has been charged with plotting to help the Islamic State group and contemplating a Fort Hood-style attack against the U.S. military.

Mohamed Jalloh, 26, of Sterling, made a brief initial appearance Tuesday afternoon in federal court in Alexandria. A judge ordered Jalloh held without bond pending a detention hearing next week.

His lawyer, Ashraf Nubani, declined comment.

Jalloh told a government informant he quit the Army National Guard after hearing lectures from radical cleric Anwar al-Awlaki, according to an FBI affidavit. Cotton Puryear, a spokesman for the Virginia Army National Guard, said Jalloh served as a specialist from 2009 until 2015, when he was honorably discharged.

A court affidavit spells out a three-month sting operation in which Jalloh said he was thinking about carrying out an attack similar to the 2009 shootings at Fort Hood, which left 13 people dead. Authorities say the sting operation began after Jalloh made contact on his own with Islamic State members in Africa earlier this year.

Jalloh's case is the most recent of several in which men from the northern Virginia area just outside Washington have been charged with attempting to support the Islamic State group.

Court records indicate the FBI saw Jalloh buying an assault rifle Saturday at a gun shop in Chantilly. The affidavit does not say if authorities believe Jalloh planned to use the rifle himself or bought it on behalf of an informant. He was arrested Sunday.

Jalloh's sister, Fatmatu Jalloh, said in a brief telephone interview that she is serving as one of her brother's attorneys. She said she had not yet seen the unsealed charges but denied he would be helping the Islamic State group.

Jalloh is identified in the affidavit as a naturalized U.S. citizen from Sierra Leone.

The affidavit says the investigation began in late March, when an unidentified member of the Islamic State group introduced Jalloh and a government informant. According to the affidavit, Jalloh had been communicating with the Islamic State member, who is now dead, before he interacted with the informant. The FBI agent says in the affidavit that he believes Jalloh met the Islamic State member on a trip to Africa early this year.

In April, Jalloh told the informant he had been thinking about carrying out a Fort Hood-style attack. Asked to explain, Jalloh said, "Nidal Hasan type of things. That's the kind of stuff I started thinking," according to the affidavit. Hasan, the Army officer convicted of the Fort Hood shootings, was also inspired by al-Awlaki.

Later in April, Jalloh told the informant that the Islamic State group had asked if he wanted to participate in an attack. According to the affidavit, Jalloh told the Islamic State representative, "I really want to but I don't want to give my word and not fulfill it."

In May, according to the affidavit, Jalloh tried to donate $500 to the Islamic State, but the money actually went to an account controlled by the FBI.

Last month, the affidavit says, Jalloh drove to the Charlotte, North Carolina, area with another person looking for weapons to buy.

On Friday, Jalloh tried to buy an AR-15 assault rifle from a Chantilly gun store but was turned away because he lacked the proper paperwork. The affidavit says he returned the next day and bought a different assault rifle. Prosecutors said the rifle was rendered inoperable before Jalloh left the store, unbeknownst to Jalloh.

Jalloh's arrest comes on the heels of several other cases in the area. Mohamad Khweis of Alexandria was charged after traveling to join the Islamic State group in Iraq and Syria, then surrendering himself to Kurdish forces after becoming disillusioned with the group. Two Woodbridge men, Mahmoud A.M. Elhassan and Joseph Farrokh, were charged with trying to join the Islamic State. Farrokh has pleaded guilty, while Elhassan awaits trial.

Prosecutor John Gibbs said at Tuesday's hearing that Jalloh faces up to 20 years in prison if convicted.