A sheriff’s sergeant was among the dead after the shooter entered the Borderline Bar and Grill in Thousand Oaks, 40 miles northwest of Los Angeles, and started firing into a crowd of around 200 people at 11.20pm local time.
The suspect, described as wearing a black trench coat and mask covering his face, died inside the bar, Ventura County sheriff Geoff Dean said.
“It is a horrific scene in there, there is blood everywhere, and the suspect is part of that,” he said.
Sheriff Dean said around 10 other people were shot and wounded with an additional 10-12 walking wounded. No other information on the victims was immediately known.
“We don’t know who shot anybody at this point,” Mr Dean said, adding that the suspect was yet to be identified.
Witnesses said the gunman shot a security guard standing at the door of the bar before entering the building and throwing “smoke grenades all over the place”. A female cashier was said to be among the victims.
Several witnesses told ABC 7 the man was armed with a handgun. Others reported seeing a high-capacity magazine or “Uzi-style” weapon.
At least 30 shots were fired before people inside the bar began using chairs to smash windows to escape, the witness said.
Teylor Whittler, 19, was on the dance floor when the shooting started. She said: “I heard the gunshot, turned around and saw him shoot a couple more times.
“Within a split second everyone yelled ‘get down’. I ran to where the back door is, and everyone dog-piled on top of each other. It was silent for a couple of seconds and then all of a sudden a couple of guys started running to the back door and said ‘get up he’s coming’.
“It was a huge panic, everyone tried getting up, and some guy came behind me, lifted me up and said ‘let’s go’. I got a bar stool thrown at my head because they were trying to use it to get out.”
Nick Steinwender, student body president at nearby California Lutheran University, rushed to the scene when he heard about a shooting at the bar where he knew friends and fellow students were inside.
“It was chaos, people jumping out of windows, people hopping over gates to get out,” he told KABC-TV.
The website for Borderline bar showed that Wednesday nights are College Country Nights that last from 9 pm until 2am.
Thousand Oaks, a wealthy city home to several colleges and universities, is ranked as one of America’s safest cities by the FBI.
The US has suffered a succession of deadly incidents involving guns in recent days, including a shooting in a yoga studio in Florida that left two people dead and five injured.
Late last month a gunman entered the Tree of Life synagogue in Pittsburgh just as Shabbat services were beginning and started shooting, killing 11 people and wounding six others in the deadliest attack on Jews in US history.