A federal appellate judge admonished the New York Attorney General’s Office over its defense of a conviction won by prosecutors in a 2009 rape case, calling the state’s position “sinister abuse” and “disreputable.”

Judge Dennis Jacobs, of the U.S. Court of Appeals for the Second Circuit, said the majority should have allowed inmate Terrence Sandy McCray’s challenge to his detention to move forward. McCray was convicted of rape in a New York state trial court, and argued the court’s decision to deny him access to his accuser’s mental health records deprived him of his confrontation and due process rights under the U.S. Constitution. Two state appeals courts disagreed with his argument, and McCray brought his challenge to federal court, starting in the U.S. District Court for the Northern District of New York.