Texas' highest criminal court Wednesday upheld a former justice of the peace's conviction and death sentence for killing a district attorney's wife in what prosecutors said was a revenge plot that left three people dead.

Attorneys for Eric Williams argued to the Texas Court of Criminal Appeals that there were 40 errors at his December 2014 trial, where a jury decided he should die for the killing of 65-year-old Cynthia McLelland. She and her husband, Kaufman County District Attorney Mike McLelland, 63, were shot to death in their home in Forney, a suburb east of Dallas, in 2013.

Williams, 50, has been charged but not tried for the deaths of Mike McLelland and his chief assistant prosecutor, Mark Hasse. Hasse, 57, was fatally shot two months earlier outside the Kaufman County courthouse.

Authorities said Williams was upset because the prosecutor's office had pursued charges alleging that he stole some county-owned computer equipment and the conviction cost him his law license and job.

Williams' appeals lawyers, from the state Office of Capital and Forensic Writs, did not immediately reply to a phone message seeking comment.

In their appeal, they questioned whether the evidence presented at the trial was sufficient to merit a conviction or death sentence.

In its ruling, the appeals court found that the severity and the number of bullet wounds Cynthia McLelland and her husband suffered "left no room for doubt concerning (Williams') intent to kill the couple." She was shot five to eight times and her husband at least 10 times.

The court also found that evidence showing Williams "planned and executed the murders of three people in two separate incidents" supported the jury's finding that he was a future danger, one of the questions jurors must answer affirmatively in deciding a death sentence.

Williams' appeal also challenged the jury selection, the wording of instructions and verdict forms given to jurors, whether the trial judge properly excluded some defense evidence, and testimony from some prosecution witnesses.

Williams' wife, Kim, testified that she drove the getaway car in Hasse's death and helped her husband dispose of weapons used in the shooting of the McClellands. She also said her husband had a hit list that included a former judge and another prosecutor.

She subsequently pleaded guilty to her role in the slayings and is serving a 40-year prison term.