The gunman who entered a Southern California bar Wednesday night and shot dead 12 people, including a sheriff’s sergeant, before killing himself has been identified as U.S. Marine Corps veteran Ian David Long.

Ventura County Sheriff Geoff Dean said Long, 28, was found dead in the Borderline Bar & Grill in Thousand Oaks late Wednesday. It was unclear how he died, but Dean said it’s believed he killed himself.

‘We thought it was a joke’: Witnesses recount the chaotic scene as a gunman opened fire

‘We thought it was a joke’: Witnesses recount the chaotic scene as a gunman opened fire 1:26

A gunman opened fire around 11:20 p.m. PT at the crowded country-and-western bar about 65 kilometres northwest of Los Angeles, sending hundreds fleeing, including some who used barstools to break windows and escape. Police said hundreds were inside at the time.

Dean said Long first shot a security guard and other staff near the door and then patrons.

Among the dead was sheriff’s Sgt. Ron Helus, who was shot multiple times as he entered the building.

Dean said Helus, a 29-year veteran of the force who was set  to retire soon, died in hospital early Thursday.

“It’s a horrific scene in there,” Dean said during a news conference Thursday morning. “There’s blood everywhere.”

Dean said around 10 other people were injured and taken to local hospitals. Others had fled and taken themselves to hospital. People had been hiding in bathrooms and the attic of the bar, and some escaped by breaking windows, Dean said.

No other information on the victims was immediately known.

Gunman acted alone, police believe

Dean said Long was acting alone, armed with a Glock 21 — a .45-calibre handgun designed to hold 10 rounds plus one in the chamber. But the sheriff said the gun had an extended magazine that is illegal in California.

Dean said his department had several previous contacts with Long, including a call to his home in April, when deputies found him behaving irate and irrationally.

The sheriff said a mental health crisis team was called at that time and concluded that Long did not need to be taken into custody.

In this image taken from video, a victim of the shooting is treated near the scene. (RMG News via AP)

Dean said there is nothing that would lead him to believe terrorism was the motive, but it has not been ruled out. Authorities hope to learn more when a search warrant is served at Long’s home in the nearby community of Newbury Park. 

The gunman was tall and wearing all black with a hood over his head and his face partly covered, witnesses told TV stations at the scene. He first fired on a person working the door and then appeared to open fire at random at the people inside, they said.

People screamed and fled to all corners of the bar, while a few people threw barstools through the windows and helped dozens to escape, witnesses said.  

Scenes from Thousand Oaks, where a gunman opened fire Wednesday night in country-and-western bar

Scenes from Thousand Oaks, where a gunman opened fire Wednesday night in country-and-western bar 0:45

College student Cole Knapp, 19, was inside the bar when he saw the gunman enter and start shooting.

“I was just with friends and I saw the shooter walk in, and he reached up to the counter like he was going to put an ID or some money up on the counter to pay his cover charge,” said Knapp, who lives nearby. “And I just kind of saw it in the corner of my eye and I heard a gunshot, and I focused on him and I saw that he was holding a handgun and he continued to shoot at the girl at the front desk.”

Tayler Whitler, 19, said she was on the dance floor and her friends were at a table by the door as the gunman opened fire. She said everyone yelled “Get down!” and it was silent for a couple seconds, then she heard “Get up, he’s coming!” and people were trampling on each other to get out.

“It was really, really, really shocking,” Whitler told KABC-TV as she stood with her father in the Borderline parking lot. “It looked like he knew what he was doing.” 

Sarah Rose DeSon told ABC’s Good Morning America that she saw the shooter draw his gun.

People comfort each other outside the Borderline Bar & Grill. (Mark J. Terrill/Associated Press)

“I dropped to the floor,” she said. “A friend yelled ‘Everybody down!’ We were hiding behind tables trying to keep ourselves covered.”

The bar is a popular hangout for students from nearby California Lutheran University. It’s also close to several other universities, including California State University Channel Islands in Camarillo, Pepperdine University in Malibu and Moorpark College in Moorpark. The bar’s website says it hosts “College Country Night” every Wednesday.

Cal Lutheran, with about 4,300 students, has cancelled classes and said on its website that the university community is invited to gather Thursday at the school’s chapel.

The sheriff’s office said a procession will take place at 10 a.m. to transport Helus via motorcade from Los Robles Hospital to the Ventura County Medical Examiner’s Office in the city of Ventura.

Shootings of any kind are rare in Thousand Oaks, a city of about 130,000. It was named the third safest city in the U.S. for 2018 by the website Niche.

“I’ve learned it doesn’t matter what community you’re in,” Dean told reporters when asked if he was surprised this happened in Thousand Oaks. “It doesn’t matter how safe your community is. It can happen anywhere.”