The state’s top criminal court on Wednesday threw out the remaining criminal charge against Rick Perry, sparing the former governor from trial and a potential prison sentence on a felony charge of misusing the power of his office.

The charge, related to Perry’s 2013 threat to veto money for Travis County prosecutors in an attempt to force District Attorney Rosemary Lehmberg from office, violated the Texas Constitution’s separation of powers provision by improperly limiting the governor’s veto authority, the Court of Criminal Appeals said in a ruling from which two of eight judges dissented.

“The constitution does not purport to impose any restriction on the veto power based on the reason for the veto, and it does not purport to allow any other substantive limitations to be placed on the use of a veto,” said the opinion by Presiding Judge Sharon Keller.

“The governor’s power to exercise a veto may not be circumscribed by the Legislature, by the courts, or by district attorneys,” Keller wrote. “When the only act that is being prosecuted is a veto, then the prosecution itself violates separation of powers.”