AUSTIN, Texas — A grand jury indicted Texas Gov. Rick Perry on Friday for allegedly abusing the powers of his office by carrying out a threat to veto funding for state prosecutors investigating public corruption — making the possible 2016 presidential hopeful his state’s first indicted governor in nearly a century.

A special prosecutor spent months calling witnesses and presenting evidence that Perry broke the law when he promised publicly to nix $7.5 million over two years for the public integrity unit, which is run by Travis County Democratic District Attorney Rosemary Lehmberg’s office.

It’s the same office that indicted U.S. Rep. Tom Delay as part of a finance probe.

Several top aides to the Republican governor appeared before grand jurors in Austin, including his deputy chief of staff, legislative director and general counsel. Perry himself did not testify, though.

Grand jurors indicted Perry on abuse of official capacity, a first-degree felony with potential punishments of five to 99 years in prison, and coercion of a public servant, a third-degree felony that carries a punishment of two to 10 years.

No one disputes that Perry is allowed to veto measures approved by the Legislature, including part or all of the state budget.

But the left-leaning Texans for Public Justice government watchdog group filed an ethics complaint accusing the governor of coercion because he threatened to use his veto before actually doing so in an attempt to pressure Lehmberg to quit.

“I took into account the fact that we’re talking about a governor of a state — and a governor of the state of Texas, which we all love,” said Michael McCrum, the San Antonio-based special prosecutor. “Obviously that carries a lot of importance. But when it gets down to it, the law is the law.”

Photo: AP

In office since 2000 and already the longest-serving governor in Texas history, Perry isn’t seeking re-election in November.

But the criminal investigation could mar his political prospects as he mulls another run at the White House, after his 2012 presidential bid flamed out.

McCrum said he’ll meet with Perry’s attorney Monday to discuss when he will come to the courthouse to be arraigned. McCrum said he doesn’t know when Perry will be booked.

Lehmberg oversees the office’s public integrity unit, which investigates statewide allegations of corruption and political wrongdoing.

Perry said he wouldn’t allow Texas to fund the unit while Lehmberg remained in charge.

Perry said Lehmberg, who is based in Austin, should resign after she was arrested and pleaded guilty to drunken driving in April 2013.

A video recording made at the jail showed Lehmberg shouting at staffers to call the sheriff, kicking the door of her cell and sticking her tongue out.

Lehmberg faced pressure from other high-profile Republicans in addition to Perry to give up her post. Her blood-alcohol level was nearly three times the legal limit for driving.

Lehmberg served about half of her 45-day jail sentence but stayed in office, despite Perry’s assertions that her behavior was inappropriate.

The jail video led to an investigation of Lehmberg by a separate grand jury, which decided she should not be removed for official misconduct.

The indictment is the first of its kind since 1917, when James “Pa” Ferguson was indicted on charges stemming from his veto of state funding to the University of Texas in an effort to unseat faculty and staff members he objected to.

Ferguson was eventually impeached, then resigned before being convicted, allowing his wife, Miriam “Ma” Ferguson, to take over the governorship.