The gunman who killed 12 people at the Borderline Bar & Grill in Thousand Oaks, California, was a 28-year-old veteran of the US Marine Corps who had previous run-ins with the law, officials said.
Here's what we know about Ian David Long so far:
The gunman is believed to have killed himself
The shooter is dead, and his body was found inside the bar when police were able to enter the building, Ventura County Sheriff Geoff Dean said.
Dean said he believed that the gunman killed himself.
The gunman used one handgun
Dean said that officials found a Glock .45-caliber handgun at the scene that was purchased legally. The weapon usually holds 10 rounds, plus one in the chamber, but the gunman used an extended magazine in this shooting, Dean said.
Dean said he did not know of the shooter's motive, and he did not know of any connection between Long and the Borderline bar.
The gunman had previous run-ins with the law
Police had several contacts with Long previously.
In April, officers responded to a disturbance at Long's home, and he was somewhat irate and acting irrationally, Dean said. A mental health specialist met with him and ultimately decided not to detain him under laws pertaining to his mental health.
Dean said that a crisis team that visited Long felt the military veteran might be suffering from post-traumatic stress disorder.
The gunman was in the Marine Corps
The gunman was on active duty with the US Marine Corps from August 2008 to March 2013, according to Defense Department records.
He posted information about his military service on a special forces forum called ShadowSpear in March 2017. Long said he had served in Afghanistan, was an infantry machine gunner in the Marine Corps for 4½ years, and was an instructor in Okinawa in Japan.
"I was honorably discharged in 2013. I am graduating with a B.S. in Athletic Training in two months," he wrote in the post. "I found out a little too late that just wasn't the job for me. Maybe the ego got the better of me but it took only one time for a 19 year old D-2 athlete to talk down to me and tell me how to do my job that I realized this wasn't the career I wanted to head."
Curtis Kellogg, a friend who served with Long, said Long headed to Southern California to pursue a degree in sports medicine after his service in Afghanistan.
"He had a great sense of humor and like most Marines who have seen combat it could get dark at times, just like all of us," Kellogg said.
"He was excited to get out so he could go back home, ride his motorcycle again and finish school."
The gunman was a student at California State University, Northridge, majoring in athletic training from 2013 to 2016, but he did not graduate, university representative Carmen Ramos Chandler said.
The gunman started firing suddenly
The gunman was dressed in black and wearing glasses when he walked into the bar filled with people enjoying a night of line dancing.
"I started hearing these big pops. Pop, pop, pop. There was probably three or four, I hit the ground," John Hedge told CNN affiliate KABC.
Holden Harrah told CNN the gunman opened fire within seconds.
"This guy just came out of nowhere and came out with a gun and shot people in Thousand Oaks, California," Harrah said. "And that's what's really blowing my mind, it's a really safe area."
Reports of the shooting came in around 11:20 p.m. PT.
"I heard a gunshot, I turned around and I saw him shoot a couple more times," California Lutheran University student Teylor Whittler told KABC. "Within a split second, everybody yelled 'get down,' " she said.
Witnesses said that people dropped to the floor and hid behind bar stools in stunned silence. Others jumped over chairs and broke windows to get out of the bar.
The gunman lived with his mother
Dean said that investigators were seeking a search warrant to look through Long's house, where he lived with his mother.
A neighbor told CNN that Long's mother "lived in fear" of what her son might do, saying when police were called to the house earlier this year "it took them about a half a day to get him out of the house."
Neighbor Richard Berge said Long's mother told him she was concerned about her son, though not worried about her own safety, and that "she was ... kind of beside herself, she didn't know what to do because he wouldn't get help."
Berge said that when he saw police activity at the house Thursday morning, "I knew what it was."
Another neighbor, Gareth Crites, said he rarely saw Long at the house. Crites would wave, but Long wouldn't wave back, he told CNN affiliate KABC.
CNN's Shimon Prokupecz, Scott Glover, Paul P. Murphy, Jose Pagliery, Cheri Mossburg, Ryan Browne and Joe Sutton contributed to this report.