The Islamic State’s flag is seen in an area of northern Iraq in September. (Associated Press)

The FBI said Monday that it has arrested a Maryland man who received thousands of dollars from Islamic State terrorists to carry out an attack on U.S. soil.

Mohamed Yousef Elshinawy, 30, of Edgewood was taken into custody Friday afternoon at his home. He was charged with providing material support to the Islamic State, lying to the FBI about money transfers and concealing evidence, according to a criminal complaint.

The complaint outlined Elshinawy’s stream of communications with Islamic State operatives who sent him nearly $9,000.

Elshinawy told the FBI that one of the militants said the money was to be used for “operational purposes”and cited the May attack on the prophet Muhammad cartoon contest in Garland, Tex., as the kind of target he should contemplate, according to court documents.

The FBI arrested a 30-year-old Edgewood, Md. man who was charged with providing material support to the Islamic State. The FBI said that Mohamed Yousef Elshinawy received nearly $9,000 from Islamic State militants. (WUSA 9)

The FBI said Elshinawy earlier this year pledged allegiance to the Islamic State, also known as ISIS, and wanted to die as a martyr.

Elshinawy told the FBI that he never intended to carry out an attack and was simply going to take the money from those “thieves.” He suggested to the FBI that he should work for them to identify the Islamic State’s money network, according to the complaint.

The FBI said he used the money to buy phones, calling cards and a laptop computer. The FBI wasn’t able to account for all the money, some of which went toward personal expenses.

Elshinawy used social media, multiple email accounts and “pay as you go” phones to communicate with Islamic State operatives, the FBI said.

The bureau first learned about Elshinawy’s connections to the Islamic State in June after it became aware of payments to him that originated overseas.

Elshinawy, who remains in custody, appeared Monday in federal court in Baltimore. Federal public defender Joseph A. Balter said, “We consider this to be a very early stage in the proceedings. We hope the public reserves judgment.”

Elshinawy is one of dozens of people who have been arrested in the past year in connection with the Islamic State as the FBI has sharply ramped up efforts to blunt the threat from the militant group. Unlike many other FBI arrests that have relied on much-criticized stings, court documents indicate that the bureau disrupted a possible terrorist attack.

Elshinawy’s arrest comes on the heels of the deadliest terrorist attack since Sept. 11, 2001, in which a husband and wife killed 14 people in San Bernardino, Calif.

The couple, who were killed in a shootout with police, pledged allegiance to the Islamic State just before the attack.

Authorities also announced Monday that Hasan Rasheed Edmonds, 23, a former Illinois National Guard soldier, had pleaded guilty to conspiracy to provide and attempting to provide material support to the Islamic State.