FRANKFORT, Ky. — A Kentucky judge has permanently blocked Republican Gov. Matt Bevin’s order replacing the board of trustees at the University of Louisville, his second defeat in an ongoing feud with one of the state’s most powerful political families.

In June, Bevin abolished the university’s board because he said it had a “strained relationship” with the university’s administration and had become “operationally dysfunctional.” He replaced the board with a new one days later.

Democratic Attorney General Andy Beshear had sued, arguing Bevin’s order was illegal. On Wednesday, Franklin Circuit Judge Phillip Shepherd agreed, saying Bevin broke the law because he didn’t give board members “any legal process to determine the merits of the charges.”

“He served as judge, jury and executioner of the incumbent board,” Shepherd wrote. “Such control would establish a dangerous precedent that invites the abuse of power.”

Shortly after Bevin replaced the board, then-university president James Ramsey resigned.

Shepherd ruled Wednesday that Bevin “improperly” agreed to fire the board in exchange for Ramsey’s resignation. If that finding stands, it could impact the university’s accreditation. The Southern Association of Colleges and Schools Commission on Colleges has ordered a formal review of the university, citing “the potential for undue political influence.” If the university loses its accreditation, its students would risk losing their federal financial aid.

“What our students and faculty need now is finality,” Beshear said in a statement. “That is why I am calling on Gov. Bevin to either accept the ruling and appoint trustees to the five openings, or agree to move this case immediately to the Kentucky Supreme Court.”

A Bevin spokeswoman said his lawyers are “taking the time to properly review the ruling.” Acting university President Neville Pinto said “we look forward to the final resolution of this issue.”

For months, Bevin has been locked in a bitter feud with Beshear and his father, former Democratic Gov. Steve Beshear. Bevin hash called his predecessor “an embarrassment” and has awarded a private law firm a contract worth up to $500,000 to investigate former Gov. Beshear’s administration.

Steve Beshear has launched a nonprofit group dedicated to opposing Bevin’s health care policies — an unprecedented act by a former governor against a successor. His son Andy Beshear, as attorney general, has sued Bevin three times.

Last week, the state Supreme Court sided with the attorney general when it ruled Bevin didn’t have the authority to cut the budgets of public colleges and universities without state legislative approval.

On Wednesday, Andy Beshear again called on Bevin to use the court’s ruling as “a turning point” and said he hopes Bevin will stop spouting “negativism and vitriol and attacks.”

But based on a text message Bevin sent Besaher on Tuesday night, it doesn’t appear their relationship will be mended anytime soon.

“I would strongly suggest that you get your house in order. Your office is becoming an embarrassment to the Commonwealth,” Bevin wrote Tuesday, according to a screenshot of a text message released by Beshear’s office.

“Being the adult in the room, I did not respond,” Beshear said.

Bevin spokeswoman Amanda Stamper confirmed the text message, but said Beshear “manipulated” the text and “then released the altered version he created to the press in an attempt to mislead them.” The original message included a link to a story about an Attorney General investigator who made “patently false and misleading statements.”

Stamper then criticized Beshear for appointing “a deputy attorney general who almost immediately pleaded guilty to federal bribery charges” — a reference to Tim Longmeyer, who awaits scheduled sentencing Thursday in federal court.

“As you can see, his office is clearly an embarrassment,” Stamper said.