PASADENA (AP) — A federal appeals court on Friday overturned the conviction and death penalty of a man for three San Diego murders, saying he was denied a chance to argue the trial was tainted by racial prejudice.

The 9th U.S. Circuit Court of Appeals on Friday also ordered Hector Ayala freed unless the state of California planned to retry him in a “reasonable” amount of time.

Ayala was convicted in 1989 of killing three people during a 1985 drug robbery at a San Diego garage.

At trial, the prosecution excused all seven black and Hispanic jurors who might have served.

Ayala’s counsel made three motions arguing that the prosecution was systematically excluding minority jurors. The Superior Court judge accepted the prosecution’s explanations that the rejections were based on “race-neutral” reasons and denied the motions.

The appellate panel, in a 2-1 ruling, said some of those justifications appeared to be “highly implausible.”

In one case, for instance, the prosecution claimed it used a peremptory challenge to excuse a juror “because he did not dress or act like other jurors, and did not mix or socialize with them,” the court said.

Another was excused because the prosecution said it was concerned that he might not be willing to impose the death penalty. However, the appellate court noted that white jurors who seemed concerned or hesitant about the death penalty were not excused.

The appeals court said Ayala’s attorney was barred from the closed hearing where the prosecution gave its justifications and didn’t receive a transcript of the proceedings until after the trial.

That “prevented Ayala from showing that the prosecution utilized its peremptory challenges in a racially discriminatory manner, and thus permitted him to be tried, convicted, and sentenced to death by a jury selected in a manner repugnant to the Constitution,” the court said.

Ayala had appealed after a divided California Supreme Court found that there were trial errors but they were harmless.

(© Copyright 2013 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)