FRANKFORT, Ky. (AP) — Kentucky's chief justice will not remove a judge from a case involving the state's public pension system, setting up a potentially contentious court hearing Thursday about the legality of a law that prompted thousands of teachers to march on the Capitol and close dozens of school districts in protest.

Republican Gov. Matt Bevin signed a bill into law earlier this year that made changes to Kentucky's woefully-underfunded public retirement systems. It requires all new teacher hires put into a hybrid pension system. It also changes how current teachers can use their sick days to calculate their retirement benefits.

Many teachers opposed the bill, mostly because the legislature passed it on one of the final days of the legislative session without giving them a chance to read it first. Schools in more than 30 districts closed for one day in April while teachers came to Frankfort to protest.

Democratic Attorney General Andy Beshear sued to block the bill, one of the many lawsuits he has filed against Bevin. Franklin Circuit Judge Phillip Shepherd has the case. Shepherd has ruled for and against Bevin in several of the Bevin-Beshear conflicts. But Shepherd angered Bevin in this case when he ruled Bevin's lawyers could not take deposition testimony from staff in the Attorney General's Office and the Kentucky Education Association, the state's largest teachers' union.

Bevin went on talk radio and called Shepherd an "incompetent hack." Soon after, his lawyers sent Shepherd a letter asking him to recuse himself from the case. They argued he could not make a fair ruling because he is a member of one of Kentucky's retirement systems.

When Shepherd refused to step aside, Bevin's lawyers asked Kentucky Chief Justice John Minton to remove him. The request threatened to delay legal arguments in the case scheduled for Thursday, which are expected to attract more teacher protests at the courthouse in Kentucky's capital city. But Minton denied Bevin's request Wednesday afternoon, clearing the way for the hearing to proceed.

Steve Pitt, Bevin's chief attorney, cited a 1941 Kentucky Court of Appeals' decision where every member of the state's highest court recused themselves from a case relating to the retirement of judges. Pitt argued the case set the standard that "a judge with a public pension cannot sit in judgment of legislation that could affect that pension."

Minton rejected that argument. He noted the reason the judges recused themselves in 1941 is because they were the ones who had filed it. That does not apply to Shepherd.

Wednesday, Beshear accused Bevin of trying to delay the case. Portions of the pension bill are scheduled to take effect July 14.

"If your legal arguments are strong, you're not afraid of getting a ruling," Beshear said. "I believe the actions of the General Assembly and the arguments of the governor are unconstitutional. And at some level they know it."

Wednesday, during a background briefing with reporters, Bevin's legal team denied they were trying to delay the case. They noted the portion of the bill scheduled to take effect in July will not affect state workers who are contemplating retirement.