Texas Gov. Rick Perry Tuesday was booked on charges he abused his power, turning the occasion into what sounded more like a campaign rally than a humiliation. He told a cheering crowd outside the Travis County Courthouse in Austin he would "fight this injustice with every fiber of my being."

Then he ducked inside to have his mug shot taken. His first court appearance is set for Friday, CNN reported.

Perry was indicted on two felony accounts of abuse of power, both related to his efforts to get Travis County District Attorney Rosemary Lehmberg to resign after she was busted for drunk driving. The charges carry a minimum sentence of seven years and a maximum of 109. Perry was arraigned in front of Judge Bert Richardson, WFAA-TV, Dallas/Fort Worth, reported.

Specifically, Perry is charged with abuse of official capacity and coercion of a public servant for following through with a threat to defund a public integrity unit run by Lehmberg. (Ironically, the public integrity unit investigates corruption in government.) Perry's critics argue he wanted Lehmberg out because the unit was investigating one of his projects and if Lehmberg, an elected Democrat, stepped down, Perry could replace her with a Republican.

"I'm going to enter this courthouse with my head held high knowing that the actions I took were not only lawful and legal but right," Perry said as he entered the courthouse.

The Texas Democratic Party called on Perry to resign.

"Gov. Rick Perry has brought dishonor to his office, his family and the state of Texas,” the party said in a statement. “Texans deserve to have leaders that stand up for what is right and work to help families across Texas. The indictment today shows a failure of Governor Perry to follow the law.”

Perry vehemently denies the charges, arguing the funding veto was within his powers as governor. He called the indictment “outrageous” and “nothing more than an abuse of power” Saturday. Read his full statement here, or watch him deliver it himself:

The New York Times editorial page came out in defense of Perry, arguing while he isn’t perfect, the indictment against him is fundamentally flawed:

“Governors and presidents threaten vetoes and engage in horse-trading all the time to get what they want,” the editorial board wrote, “but for that kind of political activity to become criminal requires far more evidence than has been revealed in the Perry case so far.”

The Washington Post called the case against Perry "wrong-headed."

Pundits on both sides are weighing in on how the indictment could affect Perry’s potential presidential run in 2016. Some argue the indictment will actually help him by energizing his base and fueling fundraising efforts. A Perry-aligned PAC has already turned it into a campaign ad.