Mohamed Elshinawy, 33, of Maryland, also agreed to help develop weaponized drones for the Islamist terrorist group to use in Syria and Turkey

An Egyptian-American newspaper deliveryman has been jailed for 20 years after pleading guilty to receiving nearly $9,000 to plot an attack for ISIS.

Mohamed Elshinawy, 33, of Maryland, also agreed to help develop weaponized drones for the Islamist terrorist group to use in Syria and Turkey.

The US attorney's office in Maryland said Elshinawy pleaded guilty to supporting ISIS, terrorism financing and making false statements in connection with a terrorism matter.

He repeatedly lied to the FBI, saying when he was questioned about receiving $1,000 from Egypt that it was from his mother, then saying it was from a friend so he could buy an iPhone, then that it was from ISIS but he was scamming the group.

FBI Agents had wanted to ask Elshinawy why his phone number had surfaced in an investigation involving ISIS extremists and how he came to receive a $1,000 Western Union transaction from Egypt.

It was a pivotal moment in a months-long FBI investigation.

The investigation stretched from a modest town home northeast of Baltimore across multiple continents, unveiled a shadowy network of illicit payments and shell companies, and revealed a direct link to an ISIS hacker killed in Syria just before Elshinawy's arrest.

ISIS generally doesn't need to fund attacks in the U.S. given the inexpensive nature of the violence it advocates and its reliance on social media to motivate followers. Pictured: A member of the genocidal group in 2014

It also had a chilling twist: Officials say that among the roughly 150 ISIS-linked cases U.S. authorities have brought since 2014, this is the only prosecution they're aware of in which money was transmitted from ISIS operatives abroad to someone in the U.S.

Law enforcement officials involved in the case spoke to The Associated Press about it in detail, recounting a high-intensity investigation that required constant surveillance, the scouring of money transfers and concern that funds sent to Elshinawy would fund an attack.

Brian Nadeau, a Baltimore FBI assistant special agent in charge, said the case raised a lot of red flags.

'Why is the money coming this way? Who is this person? What level are they at?' he said. The FBI, he said, 'can't let someone who's receiving ISIS money be out running around. Who knows if we're in the middle of it, the beginning of it, the end, and what their plan is?'

Elshinawy's lawyers didn't return messages seeking comment, but they have argued that his social media and other communications - such as his claim that he was an ISIS soldier and was committed to violent jihad - were protected by the First Amendment, were not directed by ISIS and were merely aspirational.

Under a plea agreement, Elshinawy admitted conspiring with ISIS, but he defended himself at his sentencing hearing, saying, 'I am not a terrorist,' according to the Baltimore Sun.

It's not clear how close Elshinawy came to an attack, though FBI officials said they believed the threat of violence was real.

Elshinawy's lawyers said in a sentencing memorandum that he was provided little to no specific direction, though Elshinawy told authorities he was given multiple options for violence, including a suicide bombing, and images of individuals who were potential targets, court papers say.

ISIS generally doesn't need to fund attacks in the U.S. given the inexpensive nature of the violence it advocates and its reliance on social media to motivate followers.

The US attorney's office in Maryland said Elshinawy (pictured) pleaded guilty to supporting ISIS, terrorism financing and making false statements in connection with a terrorism matter

But officials believe jihadists exploited a personal connection: a childhood friend of Elshinawy's from Egypt who joined ISIS in Syria communicated with him on social media and encouraged him to pledge allegiance to the group.

His technological know-how and skill in covering his electronic tracks - he used encrypted communications applications and proxy servers - likely made Elshinawy a natural conduit, officials said.

Elshinawy received nearly $9,000 in money transfers, including through PayPal accounts, and used the funds for phones, a laptop and a virtual private network for communication with militants overseas.

The funds, disguised as money for printers, were routed through a web of wire transfers. Much of it came from a UK-based IT company run by Siful Sujan, an ISIS computer hacker killed in December 2015 airstrikes in Syria.

'I think they thought they were going to just have a run-of-the-mill ISIS case, and when they peeled back the onion, they realized that (Elshinawy) was a key node,' said Seamus Hughes, deputy director of George Washington University's Program on Extremism, who has written about the case.

The FBI's first interview with Elshinawy came weeks after an attempted rampage at a Prophet Mohammed cartoon-drawing contest in Texas and one day after shootings at military facilities in Tennessee.

Officials say he deflected questions about the money transfer with answers they knew were untruthful. At one point he pulled out an iPhone to display a Facebook conversation in Arabic. The English translation he provided was clearly improvised, an FBI official said.

After several hours, he admitted under pressure to receiving the money from ISIS but said he was scamming the group because he never intended to commit violence, officials said.

He said that his cleverness should be rewarded and that he should be hired by the FBI to help untangle the ISIS money network, officials say.

He repeatedly lied to the FBI, saying when he was questioned about receiving $1,000 from Egypt that it was from his mother, then saying it was from a friend so he could buy an iPhone, then that it was from ISIS but he was scamming the group

The interviews continued over several weeks, and the results from search warrants and subpoenas yielded insights that alarmed officials further.

Elshinawy had pledged allegiance to ISIS in February 2015 and, in conversations with his friend, pronounced himself ready for jihad and asked for advice in bomb-making, court papers say.

He responded to the unrest in Baltimore that followed the death of Freddie Gray by praising violence against police. And, the FBI says, he attempted to recruit a brother in Saudi Arabia to join ISIS.

Elshinawy has been in custody since his December 2015 arrest.

Agents searching his home found a box of articles about ISIS attacks. His laptop held an image of a severed head next to an ISIS flag, and he accessed on his phone images of government buildings in Baltimore that officials believe were potential targets.

'If this turned out to be successful,' said Hughes, 'it would be a whole different way of looking at ISIS external operations in the U.S.'