A California judge has dismissed misdemeanor fraud charges against Hewlett-Packard Co.'s former ethics chief and two private investigators involved in the computer maker's hunt for the source of boardroom leaks, a prosecutor said on Friday.

Judge Ray Cunningham of Santa Clara County Superior Court threw out the charges, which had accused the defendants of fraudulent wire communications, after the men completed 96 hours each of court-ordered community service, California Deputy Attorney General Ralph Sivilla said.

The dismissals on Thursday bring to an end the state's criminal case arising from a scandal that ensnared one of Silicon Valley's oldest and best-known technology companies last year. Another private investigator, Bryan Wagner, pleaded guilty to two federal counts of identity theft and conspiracy and is scheduled to be sentenced on October 3.

The state's criminal investigation helped bring attention to the tactics used by the private investigators and led to a California law making it illegal to obtain phone records through fraud or misrepresentation, a technique known as pretexting, Sivilla said.

The investigation and the filing of criminal charges all had a good effect in terms of drawing attention to this problem, Sivilla said.

The same judge in March dismissed misdemeanor charges against former HP Chairman Patricia Dunn for her role in the debacle, which involved the use of private investigators who impersonated board members and journalists to obtain private phone records.

Dunn, who was replaced as chairman by Chief Executive Officer Mark Hurd after her resignation in September, oversaw efforts to determine who leaked details of sensitive boardroom discussions to the media.

Prosecutors initially charged Dunn, former HP ethics director Kevin Hunsaker and private investigators Ronald DeLia and Matthew DePante with four counts each stemming from the spying scandal.

Cunningham dismissed the case against Dunn in March and refused to accept no-contest pleas from Hunsaker, DeLia and DePante as long as they completed the community service.

Sivilla said the defendants performed volunteer work for charities, which he declined to name, citing a court order.