A graduate of Berkeley High School in California, who reportedly told authorities he wanted to help ISIS kill 10,000 people in the San Francisco Bay Area, pleaded guilty to federal charges Wednesday, while his attorney claimed he was a victim of the “system.”

Amer Sinan Alhaggagi, 23, of Oakland, pleaded guilty in federal court to trying to provide material support or resources to a foreign terrorist organization, possession of device-making equipment and identity theft, the U.S. Attorney's Office and FBI announced.

Authorities arrested Alhaggagi in November 2016 after he bought clothes online with a phony credit card, but he was held so federal authorities could continue to investigate him, the San Francisco Chronicle reported.

Alhaggagi allegedly opened several Twitter and Facebook accounts in 2016 for ISIS supporters. He then allegedly told an undercover FBI agent that he wanted to kill 10,000 people in the Bay Area with bombs and rat-poison-laced cocaine, the Chronicle reported, citing court documents.

He met with the undercover agent, pointed out locations for terrorist attacks and brought three backpacks to be used in a future attack to a storage locker, the paper reported. But Alhaggagi broke off talks with the agent after their last meeting.

“The government sent out an undercover agent to get Amer to actually do something, take a step toward a terrorist offense. He just wouldn’t do it.”

— Mary McNamara, defense attorney

His attorney, Mary McNamara, told the East Bay Times that Alhaggagi’s actions were “stupid mistakes” and he “had no intention to do anything.” She called the government’s action a “failed sting operation.”

“The government sent out an undercover agent to get Amer to actually do something, take a step toward a terrorist offense,” she said. “He just wouldn’t do it.”

He faces a maximum of 47 years in prison. But McNamara told the Chronicle her client was “being slammed by the system” and hoped to get the sentence down to just six to seven years.

“This is really a case about what the appropriate sentence should be, and here is a young guy who is immature, said some stupid things online, and the FBI sent out their best people to try to get a sting operation going,” she said.

Alhaggagi was being held without bail in Glenn E. Dyer jail in Oakland. His sentencing was scheduled for November.