The Supreme Court said Thursday that a defendant’s rights were not violated when he was precluded from cross-examining the 3-year-old boy he was accused of beating.

The court ruled unanimously that a lower court was right to allow a teacher to testify at Darius Clark’s trial about what the child had told her and that it did not violate Clark’s constitutional right to confront his accuser, because he could not cross-examine the child.

The case, Ohio v. Clark, was among four criminal justice cases the court settled Thursday. In the others, the court ruled on two death-penalty challenges and a case about selling “analogue” drugs.

The court’s decision in the child-abuse case was important to teachers, who are often under orders to report suspected abuse.

“Mandatory reporting laws aren’t about prosecuting crimes, but are there to protect abused or neglected children and to ensure those children and their families get the help and support they deserve,” said National Education Association President Lily Eskelsen García.

The case was from Cleveland, where Clark lived with his girlfriend and her two children, identified in court papers as L.P., the 3-year-old, and A.T., 18 months. According to the opinion written by Justice Samuel A. Alito Jr., Clark was his girlfriend’s pimp and agreed to care for her children while she was in Washington working for him as a prostitute.

The 3-year-old turned up at preschool one day with bruises and cuts, and, under questioning from his teachers, identified Clark as the abuser. An investigation of the younger sibling showed similar abuse.

At trial, the 3-year-old was found incompetent to testify because of his young age, but the statements to his teachers were allowed. Clark objected that his Sixth Amendment right to confront his accusers was violated, but this was turned aside, and he was convicted and sentenced to 28 years in prison.

The Ohio Supreme Court voted 4 to 3 to overturn the conviction. The majority said previous U.S. Supreme Court decisions led to that conclusion.

But Alito said those decisions referred to statements made when trying to make a case for prosecution.

“There is no indication that the primary purpose of the conversation [with L.P.] was to gather evidence for Clark’s prosecution,” Alito wrote. “On the contrary, it is clear that the first objective was to protect L.P.”

Alito said that although the court was not adopting a rule that conversations with non-law-enforcement officers were outside the Confrontation Clause’s reach, “the fact that L.P. was speaking to his teachers remains highly relevant.”

All members of the court agreed with the outcome of the case, although Justice Antonin Scalia was highly critical of Alito’s opinion. Scalia has led an effort to revive a criminal defendant’s right to confront his accusers and said the court should not backslide.

Scalia said he wrote to “protest the court’s shoveling of fresh dirt upon the Sixth Amendment right of confrontation so recently rescued from the grave in Crawford v. Washington,” an opinion Scalia authored in 2004.

Crawford remains the law,” wrote Scalia, who was peeved enough that he went out of his way to refer to Alito as “the author” of Thursday’s opinion, rather than by name.

In death penalty cases, the court ruled for one defendant and against another.

In one 5-to-4 opinion in Davis v. Ayala, Alito wrote for the majority that Hector Ayala, convicted of triple murder in California, did not deserve a new trial. Ayala had alleged that prosecutors struck each black or Hispanic potential juror and that his attorney was not privy to the conference at which a judge ruled the strikes were allowable.

But Alito said that even if a violation occurred, it was a harmless error that would not have affected the outcome of Ayala’s trial. Justice Sonia Sotomayor dissented, joined by the court’s other liberals, Ruth Bader Ginsburg, Stephen G. Breyer and Elena Kagan.

There was an interesting sidelight to the decision. Justice Anthony M. Kennedy, part of the majority, wrote separately to express concern about the use of solitary confinement, saying it is likely that Ayala has been kept apart from others in a small cell for more than 20 years. It is a cause for concern for the judiciary, he said, and quoted Dostoevsky: “The degree of civilization in a society can be judged by entering its prisons.”

Justice Clarence Thomas responded that whatever the condition of Ayala’s accommodations might be, they are “a far sight more spacious than those in which his victims, Ernesto Dominguez Mendez, Marcos Antonio Zamora and Jose Luis Rositas now rest.”

In the other case, Brumfield v. Cain, Sotomayor and the liberals prevailed, joined by Kennedy. They said lower courts were wrong to deny killer Kevan Brumfield a hearing to determine whether his intellectual disability made him ineligible for the death penalty.

Brumfield in 1993 killed Louisiana police officer Betty Smothers, the mother of professional football player Warrick Dunn.

The analogue drug case came from Charlottesville, where individuals at a video store were suspected of distributing “bath salts,” recreational drugs that mimic the effects of cocaine, methamphetamine and other controlled substances.

Stephen McFadden was convicted after a jury was instructed that the government need prove only that he intended for the drugs to be ingested.

But the court said more is needed: that the government prove a defendant knows that he is dealing a substance regulated under the Controlled Substance Analogue Enforcement Act.

The case is McFadden v. U.S.