LOS ANGELES — A gunman threw smoke bombs and rained bullets on a crowd of hundreds inside a Thousand Oaks bar Wednesday night, killing a dozen people including a Ventura County Sheriff’s Department sergeant who was trying to stop the carnage.

Authorities have not yet identified the gunman, who died in the incident, or any of the victims inside the bar.

The gunman was dressed in black when he burst into the Borderline Bar & Grill, a country-music-themed venue that is popular with college students, around 11:20 p.m., according to Sheriff Geoff Dean.

Authorities said Sheriff’s Sgt. Ron Helus and a California Highway Patrol officer entered the bar first and were met with gunfire from the suspect, whose identity was not immediately known. Helus was shot several times and died at an area hospital early Thursday morning, according to Dean.

A 29-year veteran of the department, Helus was planning to retire next year, and Dean said he died “a hero.”

He is survived by a son and his wife, whom he called before entering the bar, Dean 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. There’s no way to process,” Dean said. “There’s no way to make sense out of the senseless.”

The first 911 calls reporting the shooting were received around 11:20 p.m., according to Dean. Helus and the CHP officer arrived on scene and engaged the suspect by 11:26 p.m., he said.

A motive in the shooting was not immediately clear, but Dean said there was no evidence linking the attack to terrorism. Police believe the shooter used a handgun in the attack.

Authorities did not immediately identify the gunman, but a law enforcement source, speaking on condition of anonymity because they were not authorized to discuss the case, described him as a 29-year-old armed with a handgun and a “smoke device.”

The shooter drove his mother’s car to the bar and did not say anything before opening fire, the official said.

Eleven victims and the shooter were found dead inside the bar by responding emergency personnel. It was not immediately clear if the shooter took his own life.

“It’s a horrific scene in there,” Dean said. “There’s blood everywhere.”

Witnesses reported a horrifying scene as gunfire echoed through the club and those inside ran for cover, in some cases using chairs to break windows to escape the building. Others hid in bathrooms and an attic as they frantically called loved ones who were hearing reports of the shooting.

Several people who escaped the bar described a gunman clad in a black shirt, black hat and black glasses. He seemed to concentrate fire on the front of the venue as soon as he entered, witnesses said.

“He just pulled out a gun and shot my friend that was working the front desk,” said Holden Harrah, 21.

Matthew Wernerstrom, a regular at Borderline, said he had been inside about an hour when he heard what he described as an unmistakable sound _ a gunshot. Wernerstrom said that as the shooter concentrated his fire on the front desk, he pulled as many people as he could to the floor and under a pool table.

He said he tried to quiet those around him and count the shots fired. Wernerstrom said that when the assailant seemed to be reloading, he urged people to smash open some of the bar’s windows with chairs, hoping to escape before the next volley of gunfire came.

“All I could think about was how helpless I was,” he said.

Teylor Whittler went to Borderline to celebrate her 21st birthday on Wednesday night. She said she was dancing with friends in the bar when she heard what sounded like firecrackers. She quickly turned and followed the noise, only to find a man holding a gun near the entrance.

Erika Sigman, 19, said she began to race toward an exit as soon as screams erupted.

“I’m a Thousand Oaks resident,” she said. “This is a safe place. My parents let me go here. This is a trusted place. ... To know that this happened in my safe place is a very, very scary thing.”

The FBI’s Joint Terrorism Task Force was sent to the scene, according to an agency spokeswoman. Representatives from the U.S. Bureau of Alcohol, Tobacco, Firearms andf Explosives were also dispatched.

An additional 18 victims who suffered injuries while trying to escape, but were not shot, were received at area hospitals in the hours after the shooting, according to Ventura County Fire Department Capt. Stan Ziegler. The severity of their injuries was not immediately known.

Wednesday nights are college-themed nights open to students as young as 18, according to the bar’s website. Witnesses said the event is popular with Moorpark college students, and the Pepperdine student newspaper tweeted that students from its campus were also inside at the time of the shooting.

Some witnesses said the bar is a hub for country music fans. They said many of the attendees Wednesday night normally attended the Stagecoach country music festival in Indio and, tragically, some were survivors of the massacre at the Route 91 Harvest Festival in Las Vegas that left 58 dead last year.

Large crowds formed in the area as friends and family members arrived at the scene to try to find out if their loved ones had survived the assault. Some who escaped the gunfire could be seen frantically talking on cellphones, desperate to get information on friends or family members who may have been trapped inside. Others announced the names of the people they were searching for as they gave live television interviews.

A hotline has been established for those seeking information about their loved ones, according to the Ventura County Fire Department, which urged people to call (805) 465-6650. A family reunification center had also been established at the Thousand Oaks Teen Center, where Mayor pro tem Rob McCoy was seen around 3:30 a.m.

McCoy embraced one couple as they walked up. Inside, he said, the mood was “somber.”

He said officials do not yet have names of the victims.

“It’s going to be real heavy when that information comes in,” he said.

At nearby Los Robles Regional Medical Center, friends and family frantically searched for loved ones they hoped were not among the victims. Adam Housley, who until six weeks ago was a national correspondent for Fox News, arrived at the hospital around 3:30 a.m. searching for his niece. A guard didn’t let him through, saying the facility was on lockdown.

He said his niece, 18-year-old Pepperdine freshman Alaina Housley, had been at the bar with several friends. Her Apple Watch and iPhone still showed her location as being on the dance floor, he said.

“My gut is saying she’s inside the bar, dead,” he said. “I’m hoping I’m wrong.”

Housley said he comes from a small, tight-knit family. But he’s been on the scene during mass shootings before as a reporter.

“You just don’t think that _ same stupid quote _ you just don’t think it’s going to happen to you,” he said.

Some of those who were inside the bar recounted near misses with the gunman. Nellie Wong, who was also celebrating her 21st birthday on Wednesday night, said she dove to the floor when the shots rang out. Wong said she believed the gunman was dressed in a black hoodie, black shirt and black pants with a scarf obscuring his face, and that he threw smoke bombs as he entered.

“Thank goodness he didn’t see me at all. I immediately stopped moving, stopped breathing,” said Wong, a student at California State University Channel Islands in Camarillo.

Aubrey Ryan, 27, of Newbury Park, said she was in the front of the restaurant with at least 15 friends when a man came in and started shooting at the ceiling.

She said the gunman shouted something but that she could not hear what he said. A friend threw her onto an outdoor balcony as the gunfire rang out so she could escape, she said.

This is the second time this year Thousand Oaks has seen violence in a crowded area. In March, a man shot and killed his wife before attempting to shoot himself at the Thousand Oaks Mall.

Around 1:30 a.m., dozens of people lined the sidewalk in Moorpark as police lights flashed through the darkness. Some sat on a concrete hill and watched from their perch.

Employees and people who had friends inside the bar huddled together, some hugging and asking one another if they had any updates from loved ones.

Tyler Odekirk, 21, started working at the bar as a security guard two months ago. He said he knew “everybody” at the bar Wednesday night because he was there so often, but he was struggling to reach friends.

“I can’t get anything to anybody that’s in there,” he said. “I had a friend call me in a panic thinking that I was there.”

Carl Edgar, a 24-year-old Tarzana resident, said he had about 20 friends inside the bar, where he is a regular. The bar is an extremely popular hangout for Moorpark College students on Wednesday nights, according to Edgar, who was speaking with friends who were inside when the shooting began.

One texted him that she was hiding in a bathroom, fearing for her life. But Edgar said he was hopeful that his friends were safe.

Some of them, sadly, had been through this before.

“There are a few people we can’t get a hold of, but in these situations people usually turn off their phones to be safe so I’m not gonna get too worried. A lot of my friends survived Route 91,” he said. “If they survived that, they will survive this.”