Santa Clara County Superior Court Judge Diane Ritchie and prosecutor Matt Harris were headed for a November runoff, with private attorney Annrae Angel trailing by a wide margin in the three-way race.

Deputy District Attorney Julianne Sylva won the two-way race for an open judicial seat over defense lawyer Dennis Alan Lempert.

Ritchie, who won an open seat for the Office 24 judicial seat in 2008, drew re-election challengers after struggling through a gaffe-filled first term that led many in the legal profession to doubt her competence. In a rare rebuke, the Santa Clara County Bar Association endorsed Harris. And more of its members rated Ritchie "unqualified" than "qualified" for the job.

The last time a Santa Clara County judge faced re-election challengers was 16 years ago in 1998, when then-prosecutor Richard Titus ran unsuccessfully against Judge Gregory Ward.

Sylva and Lempert were competing for the Office 21 judicial seat vacated after the retirement of Judge Kevin McKenney. Lempert raised eyebrows when he listed himself on the ballot as "D A Lempert," which the defense lawyer said was to counter the unfair advantage he says prosecutors from the district attorney's office typically enjoy in judicial races.

Contact Tracey Kaplan at 408-278-3482.