Police on Saturday were investigating what prompted a man dressed in black to embark on a string of shootings in the beach community of Santa Monica, killing four people before police gunned him down in a community college library.
Five other people were wounded in the shooting rampage, which unfolded just a few miles from where President Barack Obama was speaking at a political fundraiser elsewhere in Santa Monica, west of Los Angeles.
The bloodshed did not appear to be related to Obama's visit to Santa Monica and the Secret Service called it a "local police matter."
The killing spree marked the latest in string of high-profile mass shootings over the past year, including a December attack in Connecticut that killed 20 children and six adults at an elementary school and a shooting last July at a suburban Denver movie theater that killed 12 people.
Those attacks have helped reignite a national debate over gun violence in America that spurred Obama and his fellow Democrats to push for expanded background checks for gun buyers - an initiative defeated in the U.S. Senate.
Police say the carnage began at a home east of the college, where the gunman shot two people dead before apparently torching the home. The Los Angeles Times, citing law enforcement sources, reported that the first two victims were believed to be the gunman's father and brother.
Santa Monica Police Sergeant Richard Lewis said that after leaving the home the gunman carjacked a woman and ordered her to drive. Along the way he fired at least several rounds at a city bus, wounding three people.
Arriving at the college, the gunman opened fire on a red sports utility vehicle in a staff parking lot, killing the driver and critically wounding his passenger, Lewis said.
The gunman, who was armed with an AR-15 style rifle and at least one handgun, then shot and killed another victim at the college before he was slain in an exchange of gunfire with police, Lewis said.
He said investigators had not yet determined a motive for the rampage, adding: "It's a horrific event that everybody wishes never happened."
Obama had been attending a fundraising event at the Santa Monica home of former News Corp President Peter Chernin at about the time of the shooting and had just finished his remarks. He made no mention of the incident.
A Secret Service spokesman in Washington said: "We are aware of the incident and it is not impacting the visit. It's a local police matter at this point."
Obama's departure from Los Angeles was rerouted to avoid the scene, a White House press secretary said.