The shooting began at 23:20 local time on Wednesday about 40 miles (65km) north-west of Los Angeles, police say.
At least 200 people were reportedly inside the Borderline Bar and Grill, which was hosting a university student night, at the time of the attack.
Police have named the suspect as 28-year-old Ian David Long.
Officials believe the US Marine Corps veteran and local resident took his own life inside the bar.
President Trump tweeted on Thursday morning to say he been briefed on the shooting, describing it as "terrible", and praising the bravery of the police officers involved.
How did the shooting occur?
Police say the suspect, Ian David Long, was dressed in black, and forced his way into the bar after shooting the bouncer.
A college country music night was under way when the suspect apparently threw a smoke grenade before opening fire, witnesses say.
Police say he used a .45 calibre Glock semi-automatic handgun, which had an extended magazine that allowed it to carry more than its typical 11-bullet capacity.
An injured man told local television channel KTLA: "We just dropped to the ground, we heard a lot of screaming. My friend is the DJ so she cut off the music, we just heard a lot of mayhem."
Another witness, Teylor Whittler, who was celebrating her 21th birthday said: "I was on the dance floor and I heard the gunshots, so I looked back and then all of a sudden everyone screamed: Get Down!
"It was a huge panic, everyone got up, I was trampled, I was kind of left on the floor until some guy came behind me and grabbed me and dragged me out."
People reportedly escaped the bar by using chairs to break windows, while others reportedly sheltered inside the venue's toilets.
What have police said?
Ventura County Sherriff Geoff Dean described the scene inside the bar as "horrific" and said there was "blood everywhere".
He said first responders arrived just three minutes after the first emergency calls from the venue were made.
Ventura Sheriff's Sergeant Ron Helus, who later died in hospital, had tried to enter the active scene with a local highway patrolman when he was shot several times.
The husband and father-of-one had been a policeman for 29 years and was due to retire next year.
"It saddens us all and tears at our emotions. He died a hero. He went in to save lives, to save other people," the sheriff said.
"It doesn't matter how safe your community is, it doesn't matter how low your crime rate is - there are people who just don't think properly everywhere, I don't care where you are, and they commit horrific acts like this," he continued.
"There's no way to process. There's no way to make sense out of the senseless."
Police say they recovered a handgun inside the bar and found the suspect dead inside.
Who are the other victims?
It is not yet clear who the other 11 victims inside the bar are, but the Wednesday night country music event is popular with local university students.
According to the bar's website, Wednesday nights are college-themed and are open to students as young as 18.
The bar is located close to California Lutheran University, Pepperdine University and Moorpark College and is popular among students.
Footage on local media of the aftermath shows injured young people being carried away from the scene by friends.
Police say at least 10 people are known to have been injured and others are self-reporting with injuries at local hospitals.
The latest in a long line
The US has suffered from mass shootings for decades, but most of the deadliest have occurred in recent years.
In the last two weeks alone, a man shot dead two people yoga studio in Florida, and another gunman opened fire on a synagogue in Pittsburgh, killing 11.
The deadliest attack in modern US history came last year in Las Vegas when a 62-year-old man opened fire on a crowd of 22,000 country music concertgoersfrom the 32nd floor of a nearby hotel, killing 58 and wounding hundreds.
One man who survived the attack on the Borderline Bar told CBS that several attendees on Wednesday night had also been present for the Las Vegas attack on the Route 91 Harvest Festival.
"It's the second time in about a year and a month that this has happened," Nicholas Champion said.
"It's a big thing for us. We're all a big family and unfortunately this family got hit twice."