A US Marine Corps veteran with suspected mental health issues killed 12 people in a busy bar in California, including a policeman, officials say.
The shooting began at 23:20 local time on Wednesday in Thousand Oaks about 40 miles (65km) north-west of Los Angeles.
At least 200 people were reportedly inside the Borderline Bar and Grill, which was hosting a student line-dancing night.
Police named the suspect as 28-year-old Ian David Long.
Earlier this year, police mental health professionals cleared him after he was found behaving "irrationally" at his home, said authorities.
How did the shooting happen?
Police say the suspect was dressed in black, and forced his way into the bar after shooting the bouncer.
A college country music night was under way when the suspect apparently threw a smoke grenade before opening fire, witnesses say.
Police say he used a legally owned .45 calibre Glock semi-automatic handgun, which had an extended magazine that is illegal in the state of California.
The extended magazine allowed the gun to carry more than its typical 11-bullet capacity.
Police say they do not yet know how many shots were fired, or whether the gunman reloaded during the attack.
One witness, Teylor Whittler, who was celebrating a friend's 21st birthday, said: "I was on the dance floor and I heard the gunshots, so I looked back and then all of a sudden everyone screamed: 'Get Down!'
"It was a huge panic, everyone got up, I was trampled, I was kind of left on the floor until some guy came behind me and grabbed me and dragged me out."
People escaped the bar by using chairs to break windows, while others reportedly sheltered inside the venue's toilets.
At least 10 people are known to have been wounded and others are self-reporting with injuries at local hospitals.
One survivor said he and his friends also escaped death last year in the deadliest US mass shooting of modern times, when a gunman killed 58 people at a Las Vegas country music concert.
Nicholas Champion told CBS News: "We're all a big family and unfortunately this family got hit twice."
Popular among students, the bar is close to California Lutheran University, Pepperdine University and Moorpark College.
Nightmare without end
By James Cook, BBC News, Thousand Oaks
For the United States, this is the nightmare that never ends.
The names of countless schools, churches, colleges and even entire cities have become synonymous with mass murder. To the list of Las Vegas, Orlando, Virginia Tech, Sandy Hook, Sutherland Springs and Parkland we now add Thousand Oaks.
At the Borderline Bar and Grill survivors huddled together in the darkness, shivering in the clothes they had been wearing in the warm, friendly bar. Many of the patrons were regulars who had come to enjoy country music and dance together.
The mood among the little groups of friends was one of shock and despair - but what was absent was a sense of surprise.
What have police said?
Ventura County Sheriff Geoff Dean described the scene inside the bar as "horrific" and said there was "blood everywhere".
He said first responders arrived less than three minutes after the first emergency calls from the venue were made.
Ventura Sheriff's Sergeant Ron Helus, who later died in hospital, tried to enter the active scene with a local highway patrolman when he was shot several times.
The husband and father-of-one had been a policeman for 29 years and was a professional firearms instructor.
He was due to retire next year.
"It saddens us all and tears at our emotions," the sheriff said. "He died a hero. He went in to save lives, to save other people."
Sheriff Dean, who on Thursday completes his last day serving as Ventura County sheriff, warned: "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. There's no way to make sense out of the senseless."
President Donald Trump issued a proclamation ordering flags to be lowered halfway at the White House and all public and military buildings to commemorate victims of the "terrible" attack.
I have been fully briefed on the terrible shooting in California. Law Enforcement and First Responders, together with the FBI, are on scene. 13 people, at this time, have been reported dead. Likewise, the shooter is dead, along with the first police officer to enter the bar....— Donald J. Trump (@realDonaldTrump) November 8, 2018
....Great bravery shown by police. California Highway Patrol was on scene within 3 minutes, with first officer to enter shot numerous times. That Sheriff’s Sergeant died in the hospital. God bless all of the victims and families of the victims. Thank you to Law Enforcement.— Donald J. Trump (@realDonaldTrump) November 8, 2018
Who is the suspect?
Police say they have had several minor contacts with Long in recent years, including in April 2018 when they were called to his house after a report of a disturbance.
During talks with police, he appeared "somewhat irate, acting a little irrationally", the sheriff said.
A police crisis intervention team interviewed him, and determined that it was not necessary to hold him against his will in a mental health facility.
What is PTSD?
- Being caught up in a traumatic event that is overwhelming, frightening and life-threatening can lead to PTSD
- The symptoms usually start within a few weeks of the trauma, but they can start later
- After the traumatic event people can feel grief-stricken, depressed, anxious, guilty and angry
- People may have flashbacks and nightmares
- People may be 'on guard' - staying alert all the time
- Physical symptoms can be aches and pains, diarrhoea, irregular heartbeats, headaches, feelings of panic and fear, depression
- People may start drinking too much alcohol or using drugs (including painkillers).
Source: Royal College of Psychiatrists
Mental health professionals believed he suffered from PTSD (post-traumatic stress disorder), the sheriff said.
In a statement, the US Marine Corp confirmed that he had served from 2008-13 as a machine gunner and rose to the rank of corporal.
He served in Afghanistan from November 2010 to June 2011 and received the Marine Corps Good Conduct Medal, the Afghanistan Campaign Medal, and the Global War on Terrorism Service Medal.
According to the website Gun Violence Archive, more than 12,000 people have been killed by firearms in the US so far this year, including about 3,000 people under 18.
That number does not include an annual estimate of 22,000 suicides via firearm.
In the last two weeks alone, a man shot dead two people yoga studio in Florida, and another gunman opened fire on a synagogue in Pittsburgh, killing 11.