Rick Perry isn't just a longshot running for president four years after a disastrous 2012 bid. He's also running for president with the dubious -- and rare -- distinction of being under indictment.

The former Texas governor, who announced his candidacy for president Thursday, is facing two felony charges that he abused his power to cut off funding for the state's ethics agency and tried to coerce a public servant.

When the indictment first came out in August 2014, many legal  and political observers theorized that it didn't have the weight to bring down the former governor. (Besides, Perry's got got other problems stemming from his 2012 run, The Washington Post's Dan Balz points out.)

But a Republican judge has refused the Perry legal team's repeated requests to throw out the "baseless," "politically motivated" case, suggesting this could go on longer than Perry would like.

Here's what you need to know about the two-time presidential candidates' legal troubles.

The back story

In April 2013, police in Austin pulled over a woman on suspicion of driving while intoxicated. That woman turned out to be Travis County District Attorney Rosemary Lehmberg.

Lehmberg is a Democrat because the county that is home to Texas's capital city is quite liberal compared to the rest of the state.

A video of her arrest shows a defiant Lehmberg.

"If you want to put me in jail, then you're going to run my career," she says, throwing up her hands. "And that's fine."

Lehmberg pleaded guilty and was sentenced to 45 days in jail. She paid a $4,000 fine and served about half of that.

How Rick Perry got involved

Perry almost immediately called for Lehmberg's resignation. She refused. As always, politics was likely in play here: Perry would have been able to appoint a Republican to her seat.

Perry upped the ante by threatening to cut off funds for the state's public integrity unit, which is part of the Travis County District Attorney office Lehmberg runs. Perry eventually did veto $3.7 million in annual funding for the agency, which investigates and prosecutes state corruption.

What the indictment says

The two-page indictment has two counts. One says that Perry "intentionally or knowingly misused government property" by vetoing money for the ethics unit.

The second says that Perry's veto threat "intentionally or knowingly influenced or attempted to influence" Lehmberg, a public official.

It's important to always note the indictment is not an admission of guilt; it merely means a grand jury decided there is enough evidence for prosecutors to pursue the case. As fans of cliches will often remind you, a famous New York judge once remarked that it was possible to indict a ham sandwich. (Fact check, anyone?)

Where the case stands today

Perry's legal team is trying to make this case bigger than his actions. They say under his free-speech protections, a governor has the right to cut off the funding for agencies if the head won't meet his demands to quit, according to the Texas Tribune.

Moving forward with the case would "have a chilling effect" on governors who want to veto any kind of funding, they say.

"At stake is not just the freedom of one man," Perry's attorneys argued.

They've tried repeatedly to get a state appeals court to throw out both charges. But as we mentioned earlier the judge, a Republican, has refused.

Perry's attorneys are currently appealing that decision.

What this all means for Perry's presidential hopes

It's hard to say. For some conservative primary voters in Texas, the indictment from Travis County's liberal enclave could be a badge of honor, McClatchy notes.

But that finer point of Texas politics probably won't reach across a broader electorate.

For now, the indictment isn't garnering nearly as many headlines as "oops," Perry's infamous 2012 debate gaffe. Perry is ranked 10th among 16 candidates in the GOP field, according to a Real Clear Politics average of recent polls.

"It's not on people's minds at this point," Jim Henson, head of the Texas Politics Project at the University of Texas at Austin, told the Los Angeles Times. But, he added:  "The fact it hasn't been dismissed does suggest that the idea that it was frivolous and completely manufactured has not been persuasive in court thus far."

"I haven't heard two people mention it," New Hampshire GOP strategist Tom Rath also told the Times.

But the Times reports Perry has spent $1 million from his campaign chest on legal funds. So at the very least, this is amounting to an expensive headache.