THOUSAND OAKS, Calif. — A Marine Corps veteran shot 12 people dead, including a deputy, at a Southern California bar early Thursday, the third mass shooting in the U.S. in less than two weeks.

Ventura County Sheriff Geoff Dean identified the gunman as Ian David Long, 28. Authorities say he walked into the Borderline Bar & Grill, a country-western bar in Thousand Oaks, just northwest of L.A. at about 2:20 a.m. EST, and opened fire.

On Wednesday evenings, the bar hosts "College Country Nights," according to its website. Many young adults were there when gunshots rang out.

During an early-morning news conference, Dean said one of his deputies, Sgt. Ron Helus, and a California Highway Patrol officer arrived at the bar within minutes of getting the 911 call.

Helus went into the bar to save lives, recalled the sheriff as he choked up.

"Upon going into the front door, the Sheriff's sergeant was struck multiple times with gunfire," Dean said. The CHP officer rescued Helus by pulling him away from the gunfire. Helus died at a hospital, Dean said.

Law enforcement officers found 11 people and Long, a former Marine veteran, dead inside the bar, Dean said. Long's body was found inside an office, authorities said.

The Sheriff and Helus had a close relationship, even going to the gym together.

CNN reported that as of late Thursday morning, 21 people had been released from area hospitals. Some with minor injuries had driven themselves to hospital.

The FBI was at the scene. Dean said there's no known motive for the shooting at this time, but authorities don't think it was terror-related. Bomb dogs have searched the area and haven't found any bombs, even smoke bombs.

A Glock 21 .45-caliber handgun was recovered at the bar. Dean said the model of gun can hold 10 rounds, with one in the chamber. The one allegedly used by Long had an extended magazine that could hold more rounds, authorities said.

Gunman's past

Dean said Long legally bought the gun, and mental health experts had cleared him to buy the weapon. Long was on active duty with the Marines from August 2008 to March 2013, according to Department of Defense records. He'd had "minor" run-ins with authorities in the past, including a traffic collisison and being the victim of a battery.

In April, deputies called to his home found Long acting angry and irrationally, the Associated Press reported.

"This is a horrific incident, and it's part of the horrors that happen in our country and everywhere. And I think it's impossible to put any logic or any sense to the senseless," Dean said.

Helus had worked with the Sheriff's Office for 29 years and was thinking about retirement. He's survived by a wife and son. Dean said Helus was speaking to his wife right before answering the call that would be his last.

Mass shooting is 3rd in 2 weeks

The shooting at Borderline Bar & Grill comes less than two weeks after gunmen shot 13 people dead in two separate mass shootings across the country.

On October 27, 46-year-old Robert Bowers opened fire during a baby-naming ceremony at the Tree of Life synagogue in Pittsburgh. At least six others were hurt, including law enforcement officers who responded to the shooting.

Then last Friday, a gunman walked into a hot yoga studio in Tallahassee, killing two people and injuring five before killing himself. Scott Paul Beierle had a master's degee from Florida State University and had worked as a substitute teacher in Volusia County. Democratic gubernatorial candidate Andrew Gillum, who is Tallahassee's mayor, briefly stopped campaigning and returned to the city in the wake of the shooting.

Law enforcement, Trump 'saddened'

The Orlando Police Department offered its support to those impacted by the shooting, saying it knows how hard it is to deal with a shooting that affects the community. The department's tweet refers to the shooting at the Pulse nightclub in 2016.

The Daytona Beach Police also issued condolences.

President Donald Trump tweeted that he has been briefed of the shooting.

OnePulse foundation, the organization founded in the wake of 2016's Pulse nightclub shooting in Orlando, extended condolences: