CHARLESTON, W.Va. — West Virginia’s attorney general cannot use a consumer protection law to sue a Catholic diocese over sexual abuse allegations, the state’s high court said Monday.

The West Virginia Supreme Court issued its opinion in response to a lawsuit the state filed last year accusing the Wheeling-Charleston diocese of failing to publicly disclose the employment of sexual abusers in its schools and camps. The absence of such disclosure amounted to a violation of a consumer protection law, Attorney General Patrick Morrisey argued. Attorneys for the diocese asked the court to dismiss the suit.

The narrow legal question concerned whether using the 2015 Consumer Credit and Protection Act to sue the diocese violates the separation of church and state. A lower court judge had stayed his order to dismiss Morrisey’s lawsuit pending the Supreme Court’s review.

In its majority opinion, the high court said the law does not apply to services provided by a religious institution.

Tim Bishop, a spokesman for the diocese, said in a statement, “We affirm our full commitment to transparency about our schools and to the protection of those young people entrusted to our care across the State of West Virginia.”

Among the lawsuit’s allegations was that the diocese failed to conduct more than 20 background checks at a Catholic elementary school in Charleston in 2007 and 2008. It also accused the diocese of covering up a 2006 report on sexual abuse allegations involving a teacher in Kanawha County.

Morrisey said in a statement that the case “may have proceeded if not for the Legislature inserting an exception for religious schools in a separate statute.” He said the legislature could amend that exception in the future.

“Despite the majority opinion, we remain proud of our efforts to protect West Virginia children, for our investigative subpoena is likely the only reason we have a list of 40 priests who are credibly accused of sexually abusing minors,” Morrisey said.

The diocese released the list of 40 credibly accused priests over the past year, saying it was committed “to transparency and accountability.”