MARTINEZ -- A judge dismissed a rape case Wednesday against a Contra Costa County sex crimes prosecutor who had been accused of using a gun, an ice pick and handcuffs to sexually assault a junior colleague during a lunch break in 2008.

The state attorney general won a grand jury indictment against Michael Gressett in October 2009. But Judge Thomas Hastings threw it out Wednesday after defense attorneys argued that prosecutors had failed to present exculpatory evidence to the grand jury.

In a 68-page ruling, Hastings said the grand jury should have heard evidence that Gressett's accuser had at one point told a colleague that she had been raped - not by Gressett but by a knife-wielding stranger in a van who abducted her.

The judge also said the jury needed to know that the woman was, at the time of her testimony, in the process of securing a $450,000 settlement from the county over the alleged attack.

Attorney General Kamala Harris must now decide whether to file new charges against Gressett, 54, whose case divided his office and riveted the local law enforcement community.

"We're reviewing the decision and evaluating our options," said Lynda Gledhill, a spokeswoman for Harris, whose office handled the case to avoid conflicts of interest.

Dan Russo, an attorney for Gressett, said he was relieved at the ruling by Hastings, a retired Santa Clara County judge brought in to oversee the case. Russo declined to comment further.

Gressett, who is out on bail, had faced 13 criminal counts including rape and sodomy.

The ruling came eight months after an arbitrator cast doubt on the account of Gressett's 33-year-old accuser and ordered the county to reinstate him with back pay. Gressett, who had been fired before being indicted, is on paid leave.

The arbitrator agreed with the defense's contention that the case was muddied by politics. Gressett's attorneys asserted he was targeted because he ran unsuccessfully three times for district attorney and supported Mark Peterson for the job last year.

Then-District Attorney Robert Kochly and his top deputies - including Paul Sequeira, who led the initial Gressett probe - supported a former prosecutor and judge, Dan O'Malley. Peterson defeated O'Malley in November.

The Gressett case has been contentious, and unusual, from the start.

His accuser told police he raped her at his Martinez home while the two were on a lunch break May 8, 2008. The woman said she had wanted to sleep with Gressett, but objected to the type of sex he initiated. He pressed on, she said, sodomizing her, holding a gun to her head, handcuffing her and jamming ice into her.

Gressett said the sex had been kinky but mutual - that a gun, cuffs and ice were brought out but only in a playful way.

The woman, who now lives in Florida, did not immediately go to police. Instead, she contacted an attorney she knew, who got in touch with Sequeira. She said she only wanted Gressett fired.

Sequeira told Kochly but didn't question Gressett, who continued to try cases. Kochly's office did not report the incident to Martinez police until Sept. 26, 2008.

The arbitrator, Norman Brand, said the woman's statements didn't add up. For instance, she told Martinez police that she "could hardly walk" after the alleged rape. But a co-worker said he had gone to a farmers' market with her minutes later and had noticed nothing unusual.

Brand said the woman had a motivation to lie because she was a contract worker. Kochly, the arbitrator said, feared she might take legal action if she weren't hired. Ultimately, she did do so, saying she was not hired because she had accused Gressett.

In his ruling Wednesday, Hastings said that if grand jurors had known of the woman's civil claim and her story about a stranger in a van, "they could have inferred (she) was willing to fabricate the allegations."