The Supreme Court on Tuesday effectively put an end to a California law that forces anti-abortion crisis pregnancy centers to provide information about abortion.

The 5-4 ruling 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 prenatal 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, in his majority opinion, said the centers 'are likely to succeed' in their constitutional challenge to the portion of the law involving licensed centers.

The Supreme Court on Tuesday effectively put an end to a California law that forces anti-abortion crisis pregnancy centers to provide information about abortion. The image above shows a stock image of a pregnancy clinic in San Diego, California

That means that while the law is currently on the books, its challengers can go back to court to get an order halting its enforcement.

An attorney for the challengers said Tuesday that they expect to be able to do that quickly.

California had not been enforcing the law, however.

'California cannot co-opt the licensed facilities to deliver its message for it,' Thomas wrote for himself, 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 joined by his liberal colleagues, Justices Ruth Bader Ginsburg, Sonia Sotomayor and Elena Kagan.

Attorney General Jeff Sessions and anti-abortion groups were among those cheering the decision.

The Trump administration had argued that California's law violates the rights of licensed centers but had no objection to the requirement for the unlicensed centers.

'Speakers should not be forced by their government to promote a message with which they disagree, and pro-life pregnancy centers in California should not be forced to advertise abortion and undermine the very reason they exist,' Sessions said in a statement Tuesday.

California Attorney General Xavier Becerra, a Democrat, called the decision 'unfortunate' but said 'our work to ensure that Californians receive accurate information about their healthcare options will continue.'

The 5-4 ruling also casts doubts on similar laws in Hawaii and Illinois. Visitors are seen leaving the Supreme Court in Washington, DC on Monday

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.

Estimates of the number of crisis pregnancy centers in the U.S. run from 2,500 to more than 4,000, compared with fewer than 1,500 abortion providers, women's rights groups said in a Supreme Court filing.

NARAL president Ilyse Hogue said in a statement after Tuesday's decision that the Supreme Court had 'turned its back on women and condoned the deceptive tactics used by fake women's health centers.'

California's law was challenged by the National Institute of Family and Life Advocates, an organization with ties to 1,500 pregnancy centers nationwide and 140 in California.

The group was represented at the Supreme Court by Alliance Defending Freedom, a Christian law firm.

NIFLA president Thomas Glessner applauded the court's decision Tuesday.

He called the decision 'monumental' and said it was a 'great day for pro-life pregnancy centers' and for free speech.

Other cities and states have also passed laws related to crisis pregnancy centers.

In 2014, a federal appeals court in New York struck down parts of a New York City ordinance, though it upheld the requirement for unlicensed centers to say that they lack a license.

Other states have laws that regulate doctors' speech in the abortion context.

In Louisiana, Texas and Wisconsin, doctors must display a sonogram and describe the fetus to most pregnant women considering an abortion, according to the Guttmacher Institute, which supports abortion rights.

Similar laws have been blocked in Kentucky, North Carolina and Oklahoma.