Texas Gov. Rick Perry (R) has been indicted on two felony counts related to his threat to veto $7.5 million for an anti-corruption office run by the Travis County district attorney. Politically, this could potentially harm Perry — his term ends next year, and a lingering court case could hamstring his widely expected run for president in 2016. It could also be a political boon, if Perry is able to shrug off these charges while winning over conservatives by casting this as more Big Government overreach from Democrats.

But let's set aside the politics. What are Perry's legal risks?

The two charges — abuse of official capacity and coercion of a public servant — stem from Perry's threat to withhold funding from the Public Integrity Unit (PIU) unless Travis County District Attorney Rosemary Lehmberg, a Democrat, resigned. Lehmberg had been arrested for drunk driving, embarrassed herself on video during the arrest, then pleaded guilty and was sentenced to 45 days in jail. Perry said at the time of his veto threat, and maintains still, that he was trying to get Lehmberg to step down because she'd lost his and the public's confidence. Perry and his legal team also underline that he has the right to veto any line in the Texas budget for whatever reason — a point nobody is really disputing. If Lehmberg had resigned, Perry would have appointed her replacement.

The charges against Perry carry possible jail terms of five to 99 years and two to 10 years, respectively. Sometime this week he will be booked, which will include a mug shot, fingerprinting, and a brief appearance before a judge.

Republicans have long chafed at the PIU, headed by the D.A. of Democratic Travis County, having the power to investigate corruption in the state capital involving state and federal officials. But the key legal question in this case is whether Perry's actions crossed a line between politicking and criminal activity.

Criminal defense lawyers, even some Democratic attorneys, are deeply skeptical. "You can't pay me enough to vote for Rick Perry, but this indictment is a totally corrupt use of criminal law," David Berg, a Houston lawyer and Democrat, tells Bloomberg News. "It is clearly political, vindictive, and unsupportable."

"It does not seem to have been a very good exercise of prosecutorial discretion," Republican former U.S. Attorney Matthew Orwig tells The Dallas Morning News. "It seems very much to be driven by wanting to punish political conduct."

And Perry's public case is pretty compelling — there's clear, publicly available evidence that Lehmberg, a top law enforcement official in the state capital, was driving with three times the legal amount of alcohol in her blood, then threw a fit when the police arrested her. Perry made his veto threat in public, not in a smoky back room. Now the county that he punished with his veto is trying to send him to jail.

But politics cut both ways. The special prosecutor in the case, Michael McCrum, is a Republican former Dallas police officer and San Antonio defense attorney who began a career as a federal prosecutor under President George H.W. Bush. He was appointed by Bert Richardson, a Republican judge in Bexar County, which includes San Antonio. "McCrum's bipartisan credentials make criticizing the investigation as a partisan witch hunt a tougher sell," says Jay Root at The Texas Tribune. Lehmberg recused herself in the case, as did other Travis County officials.

Another wrinkle: Texans for Public Justice, the liberal watchdog group that filed the initial complaint against Perry, accuses the governor of defunding PIU to quash an investigation into a state-funded cancer program, the Cancer Prevention and Research Institute of Texas (CPRIT), that Perry had proposed and championed.

In 2012, CPRIT was found to be handing out grants without scientific review of the applications. The PIU has already secured an indictment against one senior CPRIT executive related to improper grant allocation. Grants were handed out to donors to Perry's campaign chest and that of Lt. Gov. David Dewhurst (R), The Dallas Morning News found, and CPRIT's entire scientific advisory board had resigned in 2012, alleging favoritism and other shenanigans in the grant process.

Corruption is hard to prove in court, though. Several sources tell The Texas Tribune that Perry, through emissaries, promised to restore funding to the PIU after his veto if Lehmberg stepped aside, even offering her a job in the D.A.'s office. But "the public won't know what Perry's criminal prosecution will look like until there is a trial with witnesses, evidence, and a full examination of the alleged violations," says The Texas Tribune's Root. "What might a trove of emails say? Who will testify for the prosecution?"

And that's if the case makes it to trial. Perry's legal team will try to get a judge to throw it out before it can go before a jury. Because while most legal experts, at least initially, say that the indictment is "highly unusual and will be extremely difficult to prove," says Michael A. Lindenberger at The Dallas Morning News, if the case does make it to trial, "the unpredictability of a jury makes any outcome impossible to predict."

In the meantime, McCrum says he's comfortable with the case and with the criticism. "I looked at the law and I looked at the facts," he told Bloomberg News. "The grand jury has spoken that at least there's probable cause he committed two felony crimes." The court of public opinion is still out on that claim, but the court that matters hasn't been gaveled into session yet.