LOUISVILLE, Ky. (Reuters) - Kentucky’s Supreme Court ruled on Thursday that the state’s Republican governor does not have the authority to cut public universities’ budgets.

Gov. Matt Bevin (R-KY) attends the National Rifle Association's NRA-ILA Leadership Forum during their annual meeting in Louisville, Kentucky, May 20, 2016. REUTERS/Aaron P. Bernstein

The 5-2 decision reinstates more than $18 million in funds to eight of Kentucky’s nine public universities and its community college system, and handed a victory to the state’s Democratic attorney general who has opposed the governor on several issues.

Governor Matt Bevin sought the reduction, which amounted to a 2 percent cut for each affected institution for the last quarter of fiscal 2016, to fund the state’s cash-strapped pension program. He initially had sought cuts totaling $41 million, or 4.5 percent, but reduced the amount after schools complained.

However, Attorney General Andy Beshear questioned whether the governor was empowered to order the reductions unilaterally, suing in April to block them. He argued the cuts violated budget laws and the separation of powers enshrined in the state’s constitution.

In its ruling on Thursday, the state Supreme Court noted the governor has the ability to order cuts in certain circumstances, such as when there is a budget shortfall. However, while Kentucky’s pension ranks among the least funded in the nation, this did not meet that criteria.

“The Governor, as the chief executive of this Commonwealth, has only the authority and powers granted to him by the Constitution and the general law,” wrote Deputy Chief Justice Mary Noble in the court’s opinion.

In a statement, Bevin’s press secretary said the governor strongly disagreed with the ruling, saying the universities, which participate in the pension program, should participate in funding its $35 billion liability.

“Gov. Bevin recognizes that preserving our retirement systems for state workers and retirees is both a legal and moral obligation,” Amanda Stamper said.

Bevin and Beshear have had their share of conflicts since both won election last year. Bevin, who succeeded Beshear’s father, has revamped several state boards, including the University of Louisville. Beshear has challenged that order as well.

Beshear said in a statement that he hoped “after today, the nasty press releases and name calling stop, and the governor joins us for the real work that needs to be done to help Kentucky families.”