SAN FRANCISCO (AP) — An East Bay man who allegedly used social media to promote the Islamic State group has pleaded guilty to federal charges of attempting to support a terrorist organization.

23-year-old Amer Alhaggagi of Oakland entered pleas Wednesday to four charges, which also include identity theft. He could face decades in prison.

READ MORE: Three Drown In Popular Tuolumne County Gods Bath Swimming Hole

Alhaggagi was indicted in July of last year by a federal grand jury.

In a detention document filed in December of 2017, federal prosecutors told the court that Alhaggagi had spent significant time in Yemen and had allegedly met undercover agents on “numerous occasions to plan a potential terrorist attack.”

READ MORE: San Francisco Transit Officials Reopen Muni Metro Stations; Restore F-Line Trolley Service To Fisherman's Wharf

Authorities say Alhaggagi acknowledged that in 2016 he created social media accounts for people he believed were Islamic State supporters.

A court filing said Alhaggagi met with undercover federal agents to plan a potential terrorist attack.

Prosecutors say Alhaggagi possessed a device to make counterfeit credit cards and used a card in someone else’s name to buy more than $1,000 worth of clothes online.

MORE NEWS: California Drought: Water Crisis ‘Couldn’t Be Worse’ On Oregon-California Border

© Copyright 2018 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.