A 23-year-old Oakland man accused of plotting Islamic State-inspired bomb attacks in San Francisco and the East Bay pleaded guilty Wednesday to several felony charges, despite claims by his attorneys that he has no affiliation with terrorists or terrorist organizations.

Amer Sinan Alhaggagi, a Berkeley High School graduate who lived in West Oakland, pleaded guilty to attempting to provide material support or resources to a foreign terrorist organization, possession of device-making equipment, and fraud charges in Judge Charles Breyer’s federal courtroom in San Francisco.

The gallery overflowed with nearly 100 people, including relatives and members of the Bay Area’s Yemeni community, as Alhaggagi, wearing red jail-issued clothing and long dark hair that cascaded down his back, confidently answered the judge when saying he understood the charges against him.

The maximum sentence for all the charges adds up to 47 years, but Mary McNamara, Alhaggagi’s attorney, said her client “is a guy that is just being slammed by the system.”

He remains in Glenn E. Dyer jail in Oakland, where he’s being held without bail.

“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,” McNamara said, noting that she is asking that Alhaggagi serve just six to seven years.

McNamara submitted evidence in the case that she said will show Alhaggagi had no intention of committing any violent acts. She also plans to call an expert on radicalization during a November sentencing hearing to show that her client was not involved in terrorism.

Alhaggagi’s family released a statement after Wednesday’s hearing saying he was pleading guilty to “opening a handful of Twitter and Facebook accounts for ISIS sympathizers.”

“Amer is not a terrorist or a violent person, but a young man born and raised in California who said many foolish things on the Internet,” the statement says. “Amer did not commit or plan a violent act. When he was encouraged to take action by an undercover agent, he ran away.”

Alhaggagi 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 that he planned to distribute at San Francisco nightclubs, according to court documents unsealed in July 2017.

He was arrested in November 2016 for ordering clothes online with a fake credit card, but was held in custody as federal authorities built their case against him.

Prosecutors with the U.S. attorney’s office alleged that Alhaggagi detailed his plan to attack San Francisco and Berkeley with an undercover agent in an online chat room between July 24 and Nov. 29, 2016.

The plans included setting off bombs in downtown San Francisco, Chinatown and the Mission District, prosecutors said.

Investigators said they later found a bomb-making manual on his computer. Alhaggagi also said he planned to mix strychnine with cocaine and distribute the deadly drugs in San Francisco nightclubs, according to the U.S. attorney’s office.

“The whole Bay Area is going to be up in flames. My ideas are genius. Lmao,” Alhaggagi allegedly wrote, using Internet slang for “laughing my ass off.”

Authorities identified Alhaggagi after he allegedly told the undercover agent that he had applied to be a police officer in the Bay Area, and the FBI found his application with the Oakland Police Department.

The FBI then set Alhaggagi up with an undercover agent posing as an Islamic State sympathizer and bomb expert from Salt Lake City, officials said. The two met July 29, 2016, in Oakland, and Alhaggagi pointed out locations for terrorist attacks, including Tilden Regional Park in Berkeley and a building on the UC Berkeley campus, prosecutors said.

The undercover agent persuaded Alhaggagi to bring three backpacks to a storage locker that he said would be used in a future attack, prosecutors said.

Alhaggagi broke off talks with the agent shortly after the last meeting but remained under close FBI surveillance until prosecutors said he was arrested Nov. 28, 2016, for purchasing clothes online with a bogus credit card.

Evan Sernoffsky is a San Francisco Chronicle staff writer. Email: esernoffsky@sfchronicle.com Twitter: @EvanSernoffsky