A California man who admitted to setting up social media accounts to support the Islamic State (ISIS) and told an undercover FBI agent that he wanted to attack bars and nightclubs in the Bay Area was sentenced Tuesday to 15 years and eight months behind bars by a federal judge.

Amer Alhaggagi, 23, pleaded guilty in July to one count of attempting to provide services and personnel to ISIS, one count of possessing an identity theft device, one count of unauthorized identity theft and one count of aggravated identity theft. U.S. District Judge Charles Breyer ordered Alhaggagi to serve 10 years of supervised release in addition to his prison term.

The Justice Department said in a statement that Alhaggagi admitted to creating Facebook, Twitter and Gmail accounts for two ISIS supporters he met online in the fall of 2016, and created similar accounts for other people that "he believed were ISIS supporters."

ISIS BRIDE'S DAD SUING TRUMP, US TO LET HER BACK IN THE COUNTRY

Prosecutors said Alhaggagi posted a series of threats online in which he promised to "redefine terror" and vowed that "the whole Bay Area [gonna] be in flames." Authorities say one of his plans called for the detonation of a car bomb outside a gay nightclub in San Francisco and the planting of backpack bombs on streets used by emergency vehicles in a bid to kill first responders.

On another occasion, Alhaggagi was driving with an undercover agent when he pointed out bars and clubs in Berkeley "where all the students are."

"It’s a nice area to attack," Alhaggagi allegedly told the informant. "It’s like, everybody’s in their own world, just doing their thing. ... It’s not hard to target places, because there’s people everywhere. But I was trying to target, you know, like clubs, you know, like dance clubs, bars ... stuff like that."

CONVOY OF CIVILIANS LEAVES LAST ISIS VILLAGE IN SYRIA

"Alhaggagi wanted to carry out deadly terrorist attacks in the United States in the name of ISIS," Assistant Attorney General John Demers of the Justice Department's National Security Division said in a statement. "Today’s sentencing shows the dedication of the National Security Division and our partners to hold accountable those who seek to provide material support to foreign terrorist organizations and to conduct violence on their behalf."

Alhaggagi and his attorneys tried to portray the Berkeley High School graduate as an out-of-work, pot-smoking internet "troll" seeking only to provoke and annoy with violent, anti-American claims. Attorney Mary McNamara called the oldest son of Yemeni-born parents a "class clown." Federal probation officials recommended a four-year prison sentence, and 150 members of Oakland's Yemeni community signed a letter given to Judge Breyer that urged leniency. The letter said the community was creating an educational program to teach children about online behavior and speech and how to properly respond to online strangers advocating terrorism.

CLICK HERE TO GET THE FOX NEWS APP

"I find it hard to look and listen to all the horrible things I said to the undercover agent," Alhaggagi told the court before he was sentenced. "I made myself look like a crazy person."

However, Breyer rejected the defense's portrayal of Alhagaggi.

"Words matter," the judge said. "The most disturbing thing in Alhaggagi is the lack of empathy for others. That is chilling."

The Associated Press contributed to this report.