The shooting took place in early afternoon in the city of Azusa, 40 kilometres east of Los Angeles, Vanessa Lozano, spokeswoman for the Los Angeles County Fire Department, told AFP.
Officers arriving at the scene in a residential neighbourhood found "multiple shooting victims" and came under fire, Azusa police chief Steve Hunt told reporters.
He said officers tending to three victims returned fire after being shot at and the gunman was later pronounced dead at the scene.
Details about the incident and what prompted it remained sketchy.
More From This Section
Two polling stations in the area were placed on lockdown along with nearby schools, but one of the polling sites later reopened, according to local officials.
Azusa police advised residents to stay clear of the area and shelter in place as officers combed the neighbourhood looking for possible other suspects.
"Voters should avoid the area and, if necessary, cast a ballot at an alternate polling location," he tweeted.
A woman inside one of the affected polling stations said she heard shots ring out before officials placed the area on lockdown. Some 30 people were inside when the incident unfolded, she said.
"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 told CNN. "As of right now, they just have us in the voting room and are trying to keep us calm.