The pops kept coming and many in the place dived to the floor, searching for a way out. Some people moved to put themselves between the shooter and his potential targets.
Teylor Whittler, a California Lutheran University student, said there was little screaming, just gunfire and a stampede of people.
"It's a horrific scene in there," the sheriff told reporters at a media briefing. "There is blood everywhere and the suspect is part of that."
The casualties included a veteran sheriff's deputy who was nearby talking to his wife on the phone when the call came over the radio for an active shooter.
"(The deputy said), 'Hey, I have to handle a call. I love you, I'll talk to you later,' " the sheriff said.
Investigators believe Long, 28, used a legally purchased .45-caliber Glock 21 with an extended magazine during the shooting, and they're trying to figure out why he did it.
"We have no idea what the motive was at this point," Dean said Thursday afternoon.
Authorities have identified a Facebook post believed to have been made by the shooter around the time of the attack, according to a law enforcement official familiar with the ongoing investigation.
In it, the writer says: "I hope people call me insane... (laughing emojis).. wouldn't that just be a big ball of irony? Yeah.. I'm insane, but the only thing you people do after these shootings is 'hopes and prayers'.. or 'keep you in my thoughts'... every time... and wonder why these keep happening..."
When CNN read the post to a friend of Long's, who did not want to be publicly identified, the friend said, "That does not sound like Ian to me at all. I don't know what was going through his head when he wrote this. It must have been terrible."
The shooting broke out during the Western-style bar's weekly line dancing and college night open to people 18 and older. People dropped to the floor and hid behind barstools in stunned silence, witnesses said. Others jumped over chairs and broke windows to get out.
Coffman told her to get down.
"I didn't know what to do and I just followed him. I dropped down and I hid with him," she said, until he got her to run when the shooter moved away from them. She fled out the front door, but her friend died inside.
Taylor Von Molt, 21, said she was dancing when she "heard what I thought was a balloon pop."
"I heard it a couple more times, and I turned around and I saw him (the gunman)," she said. "He had ... what looked like a bandanna on the bottom on his face, sunglasses, black hoodie, dark jeans."
About 21 others were injured, many trying to escape, the sheriff's office said.
Six off-duty law enforcement officers were in the bar when the shooting happened, Dean said. Officials said they were unharmed.
Whittler told KABC that several men were in position to block the shooter "ready to take a bullet for every single one of us."
Witnesses described a man clothed in black and wearing glasses as he walked onto the dance floor filled with people and began shooting.
Von Molt ran toward the nearest exit but tripped, and people kept running on top of her in a rush to escape, she said.
John Hedge, who was at the bar with his stepfather, told KABC that he hit the ground after hearing three or four popping sounds.
"I started hearing these big pops. Pop, pop, pop," he said. When he looked up, he said, he saw a security guard who had been shot.
Nick Steinwender, who is part of California Lutheran's student government, said his friends were inside the bar when the shooting started.
"It was chaos, people jumping out of windows, hopping over gates and just trying to get out," he told KABC. "From what I heard, the gunman started shooting at the front desk. ... Students were hiding in the attics, bathrooms and stuff like that."
Long was in the US Marine Corps from August 2008 to March 2013, Defense Department records show.
Law enforcement had several previous contacts with Long, including in April when officers were called to a disturbance at his home, the sheriff said.
One of Long's neighbors, Tom Hansen, told KABC he had called police in April.
"I don't know exactly what he was doing -- it was like he was banging on the walls and shouting," Hansen said. "It concerned me, so I called the police."
Hansen told KABC everything seemed to go back to normal afterward and he never learned what had happened.
Long also had been a victim of battery at a different Thousand Oaks bar in January 2015, the sheriff said.
Long posted about his service with the Marines on an online forum called ShadowSpear in March 2017. He wrote he had been an infantry machine gunner, had served in Afghanistan and was an instructor in Okinawa, Japan.
Helus, the slain sheriff's deputy, arrived at the bar three minutes after 911 calls came in, along with two California Highway Patrol officers, Dean said.
Helus went in because gunshots still were being fired, and he was shot multiple times, Dean said.
A Highway Patrol officer pulled Helus out and waited for reinforcements. When more officers arrived, they found the gunman dead inside, Dean said.
Helus died at a hospital, police said. He is survived by a wife and a son.
"I don't think there's anything more heroic than what he did," a colleague, sheriff's Sgt. Eric Buschow, said Thursday morning.
Some of the friends of Coffman, 22, who escaped called and woke his father around 1 a.m. to tell him they didn't know if his son had gotten out.
Just before 10 a.m., the father told reporters Cody had died.
In between sobs, Jason Coffman recounted his last conversation with Cody.
"I talked to him last night before he headed out the door. First thing I said was, 'Don't drink and drive.' "
"Last thing I said was, 'Son, I love you.' "
CNN's Josh Campbell, Majlie de Puy Kamp, Cheri Mossburg, Hollie Silverman, Ryan Browne, Nicole Chavez, Keith Allen, Christina Maxouris, Paul P. Murphy, Jose Pagliery, Shimon Prokupecz, Natalie Gallón and Gianluca Mezzofiore contributed to this report.