Officials have revealed the son of a Hollywood film director stabbed to death three people at his home in southern California before going on a drive-by shooting, killing three more.
The gunman, 22-year-old college student Elliot Rodger, drove through the town of Isla Vista in a black BMW on Friday night, shooting at people in the beachside community where many college students live.
He was found dead inside a crashed vehicle with a gunshot wound to the head, authorities said.
Another seven people are in hospital being treated for bullet wounds, two in a serious condition.
Santa Barbara County Sheriff Bill Brown said the suspected gunman was armed with three legally purchased handguns registered to him and 41 loaded magazines.
He had posted a YouTube video saying he was looking forward to his "retribution day" and vowing to take revenge on people living a better life than him.
"It's obviously the work of a madman," Mr Brown told a news conference about the shooting, later adding it was "very, very apparent he was severely mentally disturbed."
Elliot Rodger's mother contacted the police after a YouTube video was posted a few weeks ago, the family's lawyer said.
Mr Brown said deputies had interviewed Rodger but found him to be polite and courteous and took no further action.
Robert Johnson, a 21-year-old University of California Santa Barbara student, said the car drove past him at a busy Isla Vista intersection and that he heard "popping noises" that he originally mistook for firecrackers or the car backfiring.
"Then the sound came again, and by that point it had pulled up in front of a convenience store deli, and someone in the car was firing into a crowd of about eight, 10 people that were gathered in front of the store," he said.
The incident was the latest mass shooting in the United States, where schools, shopping malls and military bases have been scenes of such crimes, Reuters reports.
Last month, a gunman killed three people and himself at the Fort Hood US Army base in Texas, where another gunman killed 13 people in 2009.
In December 2012, 20 children and six adults were killed in a mass shooting at an elementary school in Newtown, Connecticut. Six months before that, a gunman opened fire in a Denver movie theatre, killing 14 people.
The deadliest US mass shooting in modern times was in 2007, when a student at Virginia Tech killed 32 people.
The BBC reports that the father of one of the victims has blamed politicians and the United States gun lobby for his son's death.
Ricardo Martinez said his 20-year-old son, Christopher was killed by "craven irresponsible politicians" and the National Rifle Association.
"They talk about gun rights, what about Chris's right to live, when will enough people say stop this madness, we don't have to live like this - too many have died, we should say to ourselves, not one more!"