Investigators said Tyler Brehm, 26, walked down the middle of Sunset Boulevard on Friday, firing on motorists with no clear target until two police officers who just happened to be in the area - an off-duty motorcycle officer working movie set security and an LAPD detective - shot and killed him, authorities said.
Three people were hurt in the shooting. One of the injured was in critical condition at Cedars-Sinai Medical Center.
Amateur video taken at the scene showed the suspect pacing back and forth near the busy intersection with Vine Street, firing close to 20 rounds from what appeared to be a .40 caliber handgun.
Several witnesses reported seeing him reload at least once. One witness said the suspect was screaming that he wanted to die.
Ramon Hernandez, who lived in the apartment next door to Brehm, said Brehm and his girlfriend had recently broken up and moved out.
"I could tell that he was an unstable person," Hernandez said. "I don't know the details on what actually made him snap."
Hernandez said the couple kept to themselves.
Authorities said Brehm and his girlfriend had recently moved to Los Angeles from Pennsylvania.
The Associated Press contributed to this report.