DETROIT — Students accused of sexual misconduct at public universities have the right to cross-examine accusers at disciplinary hearings, a federal appeals court said Friday in a sweeping decision that will extend to public schools in four states.

The University of Michigan violated the rights of a male student by refusing to allow him or a representative to question witnesses in an alleged incident of sexual misconduct at a “Risky Business”-themed fraternity party, the court said.

A university investigator found insufficient evidence that a student had committed misconduct. But that conclusion was overturned by a campus appeals panel after two closed sessions.

The student’s attorney said he was made a “scapegoat” by the university to show that it was aggressively responding to complaints.

The student, identified in court papers as John Doe, agreed to leave the school in 2016 instead of face expulsion, just 13.5 credits shy of getting a bachelor’s degree in business. His attorney said he was made a “scapegoat” by the university to show that it was aggressively responding to complaints.

“If a public university has to choose between competing narratives to resolve a case, the university must give the accused student or his agent an opportunity to cross-examine the accuser and adverse witnesses in the presence of a neutral fact-finder,” said Judge Amul Thapar, writing for a three-judge panel at the 6th U.S. Circuit Court of Appeals.

The court overturned a decision by U.S. District Judge David Lawson. The ruling is binding in Michigan, Ohio, Tennessee and Kentucky, the four states covered by the 6th Circuit.

“Providing Doe a hearing with the opportunity for cross-examination would have cost the university very little,” Thapar wrote. “As it turns out, the university already provides for a hearing with cross-examination in all misconduct cases other than those involving sexual assault.”

University spokesman Rick Fitzgerald said the decision was being reviewed.

“This is a very huge victory for the constitutional rights of students,” Doe’s attorney, Deborah Gordon, said. “Sexual-misconduct proceedings have to be a search for the truth. The University of Michigan, by hiding the ball from both sides, has really done a huge disservice to the entire issue of sexual misconduct on campus. The stakes are so high.”

It’s unclear what will happen next. But Gordon said her client, who had a 3.94 grade-point average, wants his college degree.