The investigation began six months ago after a Virginia man allegedly pledged allegiance to Islamic terrorists on Facebook. It ended Wednesday with his arrest on charges he gave $250 to FBI informants pretending to buy weapons for the Islamic State group in Iraq, federal prosecutors said Thursday.

Lionel Nelson Williams, 26, of Suffolk, also owned an AK-47 assault rifle and was expressing the desire to carry out his own “martyrdom operation” in the days before his arrest, according to court documents filed by the U.S. Attorney’s Office in eastern Virginia.

U.S. Attorney’s Office spokesman Joshua Stueve said Williams lacked an attorney at his initial court appearance Thursday. He’ll be assigned a public defender if he fails to hire his own attorney by a preliminary hearing scheduled for Tuesday, Stueve said.

Irene Stewart, a longtime neighbor of Williams and his family, told the Virginian-Pilot (http://bit.ly/2hhq23e) that Williams is a “good Muslim,” who had been caring for his grandmother.