Dominick Reuter / Reuters Carmen Ortiz, the U.S. Attorney for the district of Massachusetts, has drawn criticism for overzealous prosecutions.

A federal appeals panel on Monday overturned the 2014 convictions of three former Massachusetts probation officials accused of running a patronage-based hiring system, saying the prosecution had “overstepped its bounds.”

The ruling by a three-judge panel for the U.S. Court of Appeals for the 1st Circuit is a major setback for Carmen Ortiz, the U.S. attorney for Massachusetts, who many legal experts have accused of overly aggressive prosecutions, notably in her pursuit of internet entrepreneur Aaron Swartz. Denied a plea deal that would have spared him prison time and allowed him use of a computer after his release, Swartz committed suicide in January 2013.

First Circuit Judge Juan Torruella wrote in an opinion for the majority that the hiring scheme of the probation officials ― John O’Brien, Elizabeth Tavares and William Burke ― failed to meet the legal standard for racketeering conspiracy or mail fraud.

“Although the actions of the defendants may well be judged distasteful, and even contrary to Massachusetts’s personnel laws, the function of this Court is limited to determining whether they violated the federal criminal statutes charged,” Torruella wrote. “We find that the Government overstepped its bounds in using federal criminal statutes to police the hiring practices of these Massachusetts state officials and did not provide sufficient evidence to establish a criminal violation of Massachusetts law under the Government’s theory of the case.”

Legal experts told The Huffington Post in July that Ortiz’s office had inappropriately used federal law to prosecute the case of state-level hiring. What O’Brien and his colleagues did, former federal judge Nancy Gertner said at the time, “is American politics and not a crime.”

Ortiz, who President Barack Obama appointed as a federal prosecutor in 2009, will likely lose her post after President-elect Donald Trump takes office in January. Incoming presidents from a different party than their predecessors almost always appoint new federal prosecutors.

Ortiz’ office was “disappointed” with the decision, and “will continue to fulfill our responsibility to protect the public from corrupt officials by vigorously investigating and prosecuting public corruption in appropriate cases,” spokeswoman Christina Sterling said in an email. She noted that the appeals panel agreed the government had provided evidence the defendants abused the hiring process.

That this particular conviction fell apart as Ortiz’ career as a prosecutor heads to a close has a certain irony to it.

Ortiz went after officials in Massachusetts Office of the Commissioner of Probation for what she charged was patronage-based hiring on behalf of state legislators who controlled the office’s purse strings.

But when she went after Swartz, her lead prosecutor was Stephen Heymann, who bungled the case from start to finish. Heymann happens to be he son of a powerful figure in the legal community, former deputy state attorney general Philip Heymann, who is now the James Barr Ames professor of law at Harvard.

Although Heymann may be qualified, his widely criticized handling of the Swartz case and his family background raises the appearance of nepotism. Harvey Silverglate, a criminal defense attorney critical of Ortiz, said he doesn’t believe that Heymann, who he described as an experienced prosecutor, is a beneficiary of patronage.

But Ortiz was, Silverglate argued. President Barack Obama appointed her at the recommendation of the late-Sen. Edward Kennedy (D-Mass.).

“Nobody questions that ― and the reason nobody questions that is that this is the way it’s been done: the senior senator of the same party as the U.S. president gets to appoint the U.S attorney,” Silverglate said.

“She is almost certain to be replaced by Trump because these are patronage hires,” he added.

Ryan Grim contributed reporting.

This article has been updated to include a comment from Ortiz’ spokeswoman.

Clarification: Language has been amended to reflect more accurately the status of Swartz’s case at the time of his death.