A gunman killed at least six people in Santa Monica, California, on Friday before he was shot dead by police at a library of a community college, Police Chief Jacqueline Seabrooks said.
Seabrooks said a second individual she described as a "person of interest" had been taken into custody in connection with the violence, which unfolded a few miles from where President Barack Obama was attending a political fundraiser.
Authorities also found two people dead at the scene of a nearby house fire, but police said it was not immediately clear whether the fire and the shooting incident were related.
Earlier, a spokeswoman for the California Highway Patrol had told Reuters that officers had received a report of a man armed with multiple weapons, including a shotgun, firing at passing cars and a bus at two locations near the college campus just west of Los Angeles.
Students at the campus library described a scene of pandemonium as the sounds of gunfire rang out, sending students scurrying for cover.
One student inside the library, Cyrus Jabari, 19, said he could see through a window a man dressed in black with a buzz-style haircut carrying what appeared to be an assault rifle.
"The only thing between me and him was a glass door," he told Reuters.
At a house fire a half mile away from the shooting, authorities found the bodies of two people, but it was not immediately clear if their deaths were related to the campus shooting.
Television footage broadcast by a local CNN affiliate from the scene of the fire appeared to show a car outside the home damaged by gunfire. Local television station KNBC, citing a fire department official, reported that a woman was found suffering a gunshot wound in a car outside the burned home.
One unidentified witness to the shooting told the CNN affiliate that he saw a man drive up in a car, walk into the middle of an intersection with a gun and open fire at passing vehicles and a building before "he jumped back in the car and took off."
"It seemed like he was alone in his car," the witness said, saying that he took cover under the dashboard of his car, which was struck by gunfire. "I saw him jumping out of the car. He had a big, black gun in his hand and he just started blasting maybe 10 rounds from the left to the right," he said.
Obama was 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."