WASHINGTON — The Supreme Court says a California law that forces anti-abortion crisis pregnancy centers to provide information about abortion probably violates the Constitution.

The 5-4 ruling Tuesday also casts doubts on similar laws in Hawaii and Illinois.

The California law took effect in 2016. It requires centers that are licensed by the state to tell clients about the availability of contraception, abortion and pre-natal care, at little or no cost. Centers that are unlicensed were required to post a sign that said so. The court struck down that portion of the law.

The centers said they were singled out and forced to deliver a message with which they disagreed. California said the law was needed to let poor women know all their options.

Justice Clarence Thomas said in his majority opinion that the centers “are likely to succeed” in their constitutional challenge to the law.

“California cannot co-opt the licensed facilities to deliver its message for it,” Thomas wrote for himself and his conservative colleagues, Chief Justice John Roberts and justices Anthony Kennedy, Samuel Alito and Neil Gorsuch. He called the requirement for unlicensed centers “unjustified and unduly burdensome.”

Justice Stephen Breyer said among the reasons the law should be upheld is that the high court has previously upheld state laws requiring doctors to tell women seeking abortions about adoption services. “After all, the law must be evenhanded,” Breyer said in a dissenting opinion.

The abortion-rights group NARAL Pro-Choice California was a prime sponsor of the California law. NARAL contends that the centers mislead women about their options and try to pressure them to forgo abortion.

The law was challenged by the National Institute of Family and Life Advocates, a group with ties to 1,500 pregnancy centers nationwide and 140 in California.