LOS ANGELES (Reuters) - The gunman who killed an elderly neighbor and critically wounded two other people in an Election Day shooting spree across the street from a Southern California polling station was under the influence of cocaine at the time, police said on Wednesday.

The 45-year-old suspect was killed by police gunfire on Tuesday in the normally quiet foothill town of Azusa, about 25 miles (40 km) northeast of Los Angeles, according to an update from the county sheriff's department.

Although the midday shooting rampage unfolded across the street from a polling place, disrupting voting activities at the venue, police have said it had nothing to do with the U.S. presidential election.

Authorities had said the gunman's motives were unknown. But the sheriff's department said in a statement on Wednesday that detectives since "have learned that the suspect was on a cocaine binge" when he stepped outside his home and began shooting at passing cars.

One woman was struck by gunfire while driving a van, which later crashed. The gunman then walked up to a 77-year-old neighbor and shot him dead, before shooting another woman down the street outside, police said.

The two women were hospitalized in critical condition.

Officers responding to initial reports of gunshots came under fire as they tried to assist victims at the scene. Returning fire, police then surrounded the house and cornered the suspect inside, according to authorities.

The man was found dead hours later when police finally gained entry to the home, authorities said. Neither the suspect nor his victims were publicly identified.

(Reporting by Steve Gorman; Editing by Leslie Adler)