Kentucky's flagship university failed to obey the state's open-records law when it refused to provide a campus newspaper with documents pertaining to a sexual misconduct investigation, an appeals court ruled Friday.

The case pitted the University of Kentucky against the campus newspaper and involved records from an investigation of a professor accused of sexual misconduct by two students. The professor denied the accusation but resigned as part of a settlement agreement with the university.

In an unusual twist, the university sued the newspaper — the Kentucky Kernel — in 2016 after the state's attorney general determined the school had violated the state's open-records law. UK said its dispute was with the attorney general, not the campus newspaper, but state law exempts the attorney general from being named in a party in a lawsuit.

On Friday, the Kentucky Court of Appeals sided with the newspaper and Attorney General Andy Beshear in ruling the university failed to "procedurally comply" with open-records law.

"In this instance, the university has not yet made any attempt to comply with the Open Records Act in any meaningful way," said Judge Kelly Thompson, who wrote the three-judge panel's majority opinion. "It has taken the indefensible position that the records are exempt because it says they are and it must be believed," the judge added. "That position is directly contrary to the goal of transparency under the Open Records Act."

The appeals court stopped short of requiring UK to turn documents over to the newspaper.

"While we could affirm the AG's result and order that the records requested be disclosed in redacted form to the Kernel, we refrain from doing so because that could result in the public disclosure of exempt records," Thompson wrote.

UK will review the ruling before deciding its next steps, spokesman Jay Blanton said.

"The university declined to provide redacted documents to the Kernel because the university believed that no amount of redaction would protect the student's privacy," Blanton said.

Thomas Miller, the student newspaper's lawyer, said the appeals court ruling was "absolutely right" and represented an important open-records victory for the news media.

"Going forward, educational institutions cannot hide behind a non-relevant federal law when asked to provide records about employees who are abusing students," he said.

UK argued the documents were exempt from public disclosure under the federal Family Educational Rights and Privacy Act. Blanton said Friday that other parts of the ruling reaffirmed UK's obligation to protect students' privacy.

"We continue to have grave concerns about the chilling effect any breach of a student's privacy will have on the willingness of victim-survivors to come forward and seek support and justice," he said.

The campus newspaper has already published details of the investigative documents after receiving them from a source, news outlets have reported.

The article detailed the allegations against the professor but did not identify the students who made the allegations.

The panel sent the case back to a lower court with instructions that UK show that each requested record is exempt from disclosure. The lower court had previously ruled in UK's favor.

The appeals court also ruled that the university violated open-records law by refusing to allow the attorney general to review redacted records requested by the Kernel.

Beshear on Friday called the ruling a "win for all Kentuckians who want a more open and transparent government." The AG's office has the authority to issue legally binding decisions in disputes involving open records and open meetings laws.

Beshear is seeking the Democratic nomination for governor in Tuesday's primary election.