Multiple victims have been taken to hospital with injuries.
Ventura County Sheriff's Office Captain Garo Kuredjian said the first reports of shots fired came around 11.20pm local time at the Borderline Bar & Grill in Thousand Oaks, which is about 40 miles west of Los Angeles.
"I have nothing to believe there is any terrorism link but we will certainly look at that option", he said.
Dean said the suspect had an extended magazine for his gun, and it was not clear whether he reloaded during the attack.
"They called out our crisis intervention team, our mental health specialists who met with him, talked to him and cleared him", the sheriff said.
Some people who were inside the bar said they had survived the deadly mass shooting at the Route 91 Festival in Las Vegas a year ago. The western-style bar hosts theme nights such as country, salsa and swing dancing.
"I heard a gunshot, I turned around and I saw him shoot a couple more times", student Teylor Whittler, 19, told CNN affiliate KABC.
"And tonight, as I told his wife, he died a hero because he went in to save lives".
The station said one person was seen - apparently lifeless - on the ground outside the bar's entrance. Someone yelled "Get out - he's coming", and she fled as the gunman fired another round of shots.
"A gentleman walked in the front door and shot the girl that was behind the counter".
"She was probably on the [dance] floor when this was going on, because she comes here every Wednesday night", the victim's father said.
"I think everyone was in so much of a shock that it was sheer panic", Whittler said.
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. People threw chairs out of the windows to try to get away. And then one of the guys who was there started throwing tables out the window and they picked us up and they threw me and my girlfriend out the window.