San Francisco District Attorney Kamala Harris has won the Democratic primary for state attorney general.
Harris will face Los Angeles District Attorney Steve Cooley in the general election in November to replace Democrat Jerry Brown, who is running for governor.
Harris beat Facebook executive Chris Kelly and five other candidates Tuesday. Kelly had sunk more than $12 million into the campaign.
Harris, 45, was elected San Francisco district attorney in 2003, becoming the county's first female district attorney and the first black woman elected district attorney in California. She was re-elected in 2007.
She has been dogged by a recent scandal at San Francisco's crime lab, but that did not seem to resonate with voters as a reason to reject her candidacy.