AZUSA, Calif. (AP) — A gunman was on a cocaine binge when he randomly opened fire Tuesday in a peaceful Southern California neighborhood, killing a 77-year-old neighbor and wounding two women at random before police shot him, authorities said.

The 45-year-old man was found dead in the entryway to an Azusa home, ending an hours-long standoff east of Los Angeles. His name wasn't immediately released.

The shooting that erupted at around 2 p.m. Tuesday closed two nearby polling places at a park and elementary school in the San Gabriel Valley.

However, the shooting "had nothing to do with the ballot or voting," Los Angeles County sheriff's Lt. John Corina said.

The man, a former member of the military, was a "gun fanatic" who began binging on cocaine at least a day earlier, prompting his wife and two children to leave their home Monday evening "because he was getting out of control," Corina said.

On Tuesday afternoon, the man armed himself.

"According to witnesses he came out into the street with guns and just started shooting randomly at people and cars," Corina said.

The man shot a woman who was driving a van, which later crashed, then walked up to a 77-year-old neighbor who had stepped outside to see what was happening and shot and killed him, authorities said.

He also shot another woman who was outside down the street, according to a Sheriff's Department statement.

When police from Azusa and neighboring Irwindale arrived to help the victims, the man popped out of hiding and opened fire on them with an assault rifle. The officers weren't hit and fired back, fatally wounding the man, Corina said.

He went to a home, where he died in the entryway but was only confirmed dead hours later. Weapons including a shotgun and handgun along with hundreds of rounds of ammunition were found in the home, authorities said.

The wounded women, ages 59 and 65, were hospitalized in critical condition.