A defense lawyer for an Arizona man accused of helping a 24-year-old Baruch College student join the Islamic State told Manhattan federal court jurors Wednesday that terrorist recruit Samy el-Goarany made his own fatal decision to join a “brutal gang of thugs.”

“Samy made up his own mind to join ISIS,” attorney Sabrina Shroff said in her closing argument on behalf of her client in the hotly contested trial, Ahmed Mohammed el-Gammal. “He — HE — used other people. He picked up a rifle. He picked up a 16-year-old girl as a sex slave. And he died utterly unrepentant.”

Shroff — calling el-Goarany the “only terrorist in this case” — accused the government of relying on thin evidence to “prosecute an ideology and not a person,” after prosecutors repeatedly urged jurors to use their “common sense” to convict defendant el-Gammal.

El-Gammal, 44, of Avondale, Arizona, supported ISIS online, communicated with and visited el-Goarany in the months before he traveled to Turkey and Syria, and arranged for him to be helped by a friend in Istanbul, prosecutor Negar Tekeei said, although no explicit evidence showed he knew the student was joining ISIS.

“This wasn’t all just a coincidence,” she argued. “ISIS needs people like el-Gammal to deliver people like Samy el-Goarany into its hands to engage in acts of terror around the world.”

El-Goarany, an Egyptian-American from upstate Goshen, went to the Mideast in early 2015, a half-year after first confiding his plan to join ISIS secretly to a brother, Tarek, who testified under a grant of immunity.

advertisement | advertise on newsday

He lied to his mother and friends, telling them he planned to do humanitarian work helping Syrian refugees, according to testimony, and died in battle in late 2015.

El-Gammal, who prosecutors said met el-Goarany online, allegedly provided the Istanbul contact to help the student contact ISIS, although el-Goarany made a videotape before he died saying he acted on his own. El-Gammal faces up to 55 years in prison if convicted of conspiracy to aid a terrorist organization and other crimes.

The government has portrayed el-Gammal as an ISIS sympathizer based on online posts — “I am with the State,” he said in one — and Tekeei said in her closing that he came to New York to “vet” el-Goarany as a recruit, later passing along his travel plans to the Istanbul contact.

Although the alleged plot was never explicitly laid out in messages, Takeei urged the jury to draw inferences from the three men’s use of a “code” that discussed el-Goarany’s plans to join a “company,” and from the fact that many messages were deleted or sent over encrypted channels.

“You only cover up something if you have something to hide, if you did something illegal,” she said. “That is why you have all the deletions, the encrypted messages — it’s powerful evidence.”

But Shroff described el-Goarany as a troubled middle child who had not completed college in six years, was at odds with his father, couldn’t find a girl and pursued ISIS for his own reasons without any influence from el-Gammal. “He wanted to belong,” she said.

El-Gammal, like el-Goarany’s mother and friends, was taken in by his lies about doing humanitarian work, she said, talking in code because refugee smuggling was illegal and providing a contact to help el-Goarany get settled in Istanbul.

The government, she complained prosecuted el-Gammal because they needed someone to blame, and he had expressed radical views online. “In the United States we do not criminalize beliefs,” she told jurors, “we do not criminalize ideology.”

Deliberations are expected to begin on Thursday.