TROY — A former sheriff's department attorney who dropped out of a recent judge's race has been picked to defend a man who wants to take back his guilty plea in a quadruple homicide in Troy.

Rensselaer County Judge Debra Young this week assigned Jasper Mills to represent Justin Mann in the defendant's bid to reverse his April admission that he was an accomplice in the gruesome December 2017 killings of two women and two children in Troy.

The 25-year-old pleaded guilty to four counts of second-degree murder related to his role in the deaths of Brandi Mells, 22; Shanta Myers, 36; and Myers' two children: Jeremiah Myers, 11; and Shanise Myers, 5.

Mann told the judge his co-defendant, James White, 39, carried out the killings. As part of a plea deal that cut his potential prison sentence from 50 years to life to 25 years to life, Mann agreed to testify for the prosecution at White's upcoming trial.

But the defense attorney who helped hammer out the agreement, Joseph Ahearn, said Mann wants to take his case to trial. That prompted the judge to assign Mills.

“Mr. Mann apparently changed his mind and decided he wants to have a trial on this matter, despite the favorable plea agreement that the public defender’s office obtained for him,” Ahearn confirmed Friday.

The Rensselaer County district attorney's office and Mills declined to discuss the switch.

Mills faced controversy and a political reversal earlier this year.

He was working as the $112,000-a-year counsel for Albany County Sheriff Craig Apple when he took on side work as the special prosecutor in the case of Richard Wright, who faced retrial in a 1986 arson that caused the deaths of two teenagers.

The two-week trial in July 2018 ended with Wright's conviction. In September, Mills submitted a bill to state Supreme Court Justice Andrew Ceresia seeking payment for more than 710 hours, which at an hourly rate of $150 meant Mills was due $106,575.

Ceresia ultimately rejected 251 of those hours — more than a third of Mills' billed time — as "unnecessary and/or inefficient." The judge's rejection of such a significant chunk of the bill prompted the Times Union to review court records as well as Mills' time sheets from his full-time job with Albany County.

The results of that examination of Mills' work for Rensselaer County show that between Dec. 21, 2017, and Sept. 7, 2018, he worked at both jobs on 70 days, including 37 days when Mills stated he worked a total of 14 hours or more between the two.

The Times Union subsequently reported on Mills' abortive pursuit of a part-time prosecutor's job in the town of Coeymans. Apple took issue with that side work, though Mills insisted he had briefly served as a part-time town attorney on a voluntary basis.

The revelations prompted Mills to drop out of the race for Albany County judge; he also left his post with the sheriff's department.

It is not unheard of for defendants to try to take back guilty pleas any time between when the plea is made and when sentence is imposed. But a defendant must convince a judge that a mistake was made in the process, or that they were pressured to plead guilty.

Mann's change of heart could throw off White's prosecution.

In an April court appearance to make his guilty plea, Mann said he and White arrived from Schenectady by bus and bicycle on the evening of Dec. 21, 2017, and went to the rear basement apartment at 158 Second Ave. in Troy's Lansingburgh neighborhood.

Once inside, they tied up Mells, Shanta Myers and Shanise Myers. Mann said White slashed Mells to death first, followed by Shanta Myers then Shanise Myers. When Jeremiah Myers came into the apartment, he was tied up and White killed him, Mann said.

The two men left the apartment with a flat-screen television, two Xbox game consoles and the controllers, Mann told the court. They then rode the bikes back to a nearby bus stop to catch a bus to Albany, where they transferred to another bus that took them back to Schenectady.

The bodies were discovered on Dec. 26. The two men were arrested a few days later.