The 45-year-old suspect lived in Azusa, a suburb of Los Angeles, where the shooting happened. His family told police that he had been heavily using cocaine and that they left to get away from him on Monday night.
On Tuesday afternoon, the man opened fire in his neighborhood and began shooting at random cars and passersby, killing his 77-year-old neighbor and wounding a woman, police said.
He later ambushed police when they arrived on scene, said Lt. John Corina of the Los Angeles County Sheriff's Department.
The third victim may have been hit during the ensuing gunfire -- leaving two women, ages 65 and 59, in critical condition. One of the women was shot in the face, and the other in the torso. Police said they had no identities for the three victims.
Hours after the shooting began, the unidentified suspect was found dead in his home, police said. He appeared to have been shot by police.
The shooting happened near a polling place, triggering a lockdown at the Memorial Park North Recreation Center, where voters had come to cast their ballots.
Investigators have ruled out any connection between the shooting and Tuesday's elections, Corina said.
"It was a coincidence, I think," he said. "There was an elementary school nearby, it didn't involve the school either."
Officers responded to calls about gunshots being fired and found several victims on the street, said acting Azusa Police Chief Steve Hunt.
The suspect, who was wearing military-style gear, walked up and down the street shooting people and was heavily armed, carrying a rifle, a shotgun and a handgun, authorities said.
"The suspect shot at officers when they arrived on scene, causing them to return fire," Corina said.
Five Azusa Police Department officers and one officer from the neighboring city of Irwindale fired back, he said.
The suspect was formerly in the military and had been a city employee in Orange County, police said.
Earlier, Azusa police said they were looking for a female suspect, but Corina told reporters at a late news conference that there was no evidence of another shooter.
Police searched yards in surrounding homes just to be sure there were no other victims or suspects.
The shots rang out in a working-class neighborhood, with well-kept front yards at mostly single family homes. The shootout happened right across from Memorial Park.
"It's a nice neighborhood," said resident Jason Jonasson. "My wife, myself and the kids walk our dogs every night. My daughters play basketball here. It's safe."
Frightening scene for voters
Two schools were locked down for hours following the shootings, and the polling center, along with another nearby, were "impacted," authorities said.
Two voters who were inside the Memorial Park North Recreation Center when the shooting occurred spoke to CNN, but didn't want to give their names.
One voter said he was inside when he heard a bunch of shots ring out and people from outside rushed in before officials locked the doors.
Another voter told CNN she also heard the shots.
"At first, I thought it was construction but people came running into the room saying they see a guy with a bulletproof vest and a white shirt," she said.
Officials later evacuated the building and some voters were directed to other sites to cast their ballots.