Updated

The Supreme Court ruled Tuesday in favor of pro-life crisis pregnancy centers that counsel pregnant women to make choices other than abortion, invalidating a California law requiring them to prominently post information on how to obtain a state-funded abortion.

The court, in a 5-4 ruling, said the state law likely violates the First Amendment. The court also cast doubts on similar laws in Hawaii and Illinois.

The state regulations, targeting centers that provide counseling-related services with the goal of helping women make choices other than abortion, demanded such centers prominently post information on how to obtain abortion and contraception.

The law also required unlicensed, non-medical facilities to inform clients that they are not licensed medical providers. If pregnancy centers fail to comply with the law, they’re fined $500 for a first offense and $1,000 for each subsequent offense, according to the law.

Pro-life groups had challenged the regulations, arguing that they violated their free speech rights under the First Amendment. Supporters of the law said that it was necessary since many women were unaware of the options available to them.

The 9th Circuit Court of Appeals rejected both arguments and upheld the law -- arguing that the state could regulate professional free speech and the law protects public health interests. The Supreme Court reversed that judgement.

Justice Clarence Thomas said in his majority opinion,"California cannot co-opt the licensed facilities to deliver its message for it." He also called the regulations for unlicensed facilities "unjustified and unduly burdensome."

Thomas was joined by fellow conservative justices John Roberts, Anthony Kennedy, Samuel Alito and Neil Gorsuch. Dissenting were liberal justices Stephen Breyer, Ruth Bader Ginsburg, Sonia Sotomayor and Elena Kagan.

Breyer, in his dissent, 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.

Kevin Theriot, Senior Counsel for the Alliance Defending Freedom, which represented the plaintiffs, told Fox News that "free speech won today."

"California used its power to force pro-life pregnancy centers to provide free advertising for abortion," he said. "In stopping enforcement of this law, the Supreme Court said, 'The people lose when the government is the one deciding which ideas should prevail.'

California Attorney General Xavier Becerra called the ruling "unfortunate."

“When it comes to making their health decisions, all California women -- regardless of their economic background or zip code -- deserve access to critical and non-biased information to make their own informed decisions,” Becerra said in a statement.

“Today’s Court ruling is unfortunate, but our work to ensure that Californians receive accurate information about their healthcare options will continue.”

Fox News’ Bill Mears, Madeline Farber and The Associated Press contributed to this report