AUSTIN, Texas — A grand jury indicted Texas Gov. Rick Perry on Friday for 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 District Rosemary Lehmberg’s office. 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 wasn’t called to testify.

He was indicted by an Austin grand jury on felony counts of abuse of official capacity and coercion of a public servant. Maximum punishment on the first charge is five to 99 years in prison. The second is two to 10 years.

Perry said Lehmberg, who is based in Austin, should resign after she was arrested and plead 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 served about half of her 45-day jail sentence but stayed in office, despite Perry’s assertions that her behavior was inappropriate.

Perry eventually carried out his veto threat. No one disputes that he 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 since he threatened to use his veto before actually doing so in an attempt to pressure Lehmberg to quit.

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 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.

In office since 2000 and already the longest-serving governor in Texas history, Perry isn’t seeking re-election in November. But the ongoing criminal investigation could mar his political prospects as he mulls another run at the White House, after his 2012 presidential bid flamed out.

Lehmberg, a Democrat, 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, and she eventually served about half of a 45-day jail sentence.

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

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. He used his line-item veto power to remove funding for the unit from the Texas budget.

Perry and his aides say he didn’t break any laws.

“The veto in question was made in accordance with the veto power afforded to every governor under the Texas Constitution, and we remain ready and willing to assist with this inquiry,” spokeswoman Lucy Nashed said in April, after the grand jury was convened in the case.