FILE - In this Oct. 10, 2017, file photo, the Supreme Court in Washington is seen at sunset. The Supreme Court is ordering Washington courts to take a new look at the case of a florist who refused to provide services for the wedding of two men because of her religious objection to same-sex marriage.  The justices' order Monday means the court is passing for now on the chance to decide whether business owners can refuse on religious grounds to comply with anti-discrimination laws that protect LGBT people.(AP Photo/J. Scott Applewhite, File)
PHOTO: J. Scott Applewhite/AP
FILE - In this Oct. 10, 2017, file photo, the Supreme Court in Washington is seen at sunset. The Supreme Court is ordering Washington courts to take a new look at the case of a florist who refused to provide services for the wedding of two men because of her religious objection to same-sex marriage. The justices' order Monday means the court is passing for now on the chance to decide whether business owners can refuse on religious grounds to comply with anti-discrimination laws that protect LGBT people.(AP Photo/J. Scott Applewhite, File)
Now playing
01:52
SCOTUS sides with faith-based pregnancy centers
WASHINGTON - FEBRUARY 05:  The U.S. Supreme Court is shown February 5, 2009 in Washington, DC. It was announced today that Supreme Court Justice Ruth Bader Ginsburg had surgery after being diagnosed with pancreatic cancer. (Photo by Win McNamee/Getty Images)
PHOTO: Win McNamee/Getty Images
WASHINGTON - FEBRUARY 05: The U.S. Supreme Court is shown February 5, 2009 in Washington, DC. It was announced today that Supreme Court Justice Ruth Bader Ginsburg had surgery after being diagnosed with pancreatic cancer. (Photo by Win McNamee/Getty Images)
Now playing
01:32
SCOTUS: States can force tax on online shoppers
Jack Phillips Today Show
PHOTO: NBC
Jack Phillips Today Show
Now playing
02:18
Colorado baker: I couldn't create this cake
A wedding cake with statuettes of two men is seen during the demonstration in West Hollywood, California, May 15, 2008, after the decision by the California Supreme Court to effectively greenlight same-sex marriage. AFP PHOTO / GABRIEL BOUYS (Photo credit should read GABRIEL BOUYS/AFP/Getty Images)
PHOTO: GABRIEL BOUYS/AFP/AFP/Getty Images
A wedding cake with statuettes of two men is seen during the demonstration in West Hollywood, California, May 15, 2008, after the decision by the California Supreme Court to effectively greenlight same-sex marriage. AFP PHOTO / GABRIEL BOUYS (Photo credit should read GABRIEL BOUYS/AFP/Getty Images)
Now playing
02:04
SCOTUS rules for baker in same-sex cake case
People wait in line to enter the U.S. Supreme Court, on April 23, 2018 in Washington, DC.
PHOTO: Mark Wilson/Getty Images
People wait in line to enter the U.S. Supreme Court, on April 23, 2018 in Washington, DC.
Now playing
01:44
SCOTUS wipes away lower court ruling
how the supreme court picks cases_00000000.jpg
how the supreme court picks cases_00000000.jpg
Now playing
01:39
How the Supreme Court picks its cases
Now playing
01:31
Supreme Court allows parts of travel ban
WASHINGTON - JUNE 25: The exterior view of the U.S. Supreme Court is seen June 25, 2007 in Washington, DC. The Supreme Court has ruled to give more freedom for interest groups and unions to run TV ads before elections, and also ruled to limit taxpayers' rights to challenge government initiatives as unconstitutionally promoting religion. (Photo by Alex Wong/Getty Images)
PHOTO: File/Alex Wong/Getty Images
WASHINGTON - JUNE 25: The exterior view of the U.S. Supreme Court is seen June 25, 2007 in Washington, DC. The Supreme Court has ruled to give more freedom for interest groups and unions to run TV ads before elections, and also ruled to limit taxpayers' rights to challenge government initiatives as unconstitutionally promoting religion. (Photo by Alex Wong/Getty Images)
Now playing
01:05
Supreme Court throws out NC redistricting maps
Pro-choice activist, Alissa Manzoeillo, of Washington, D.C. waits for rulings in front of the U.S. Supreme Court  on June 27, 2016 in Washington, DC. A ruling is expected in Whole Woman's Health v. Hellerstedt, a Texas case the places restrictions on abortion clinics, as well as rulings in the former Virginia Governor's corruption case and a gun rights case.
PHOTO: Pete Marovich/Getty Images
Pro-choice activist, Alissa Manzoeillo, of Washington, D.C. waits for rulings in front of the U.S. Supreme Court on June 27, 2016 in Washington, DC. A ruling is expected in Whole Woman's Health v. Hellerstedt, a Texas case the places restrictions on abortion clinics, as well as rulings in the former Virginia Governor's corruption case and a gun rights case.
Now playing
01:25
Supreme Court rules on Texas abortion law
Obama Supreme Court immigration ruling_00000000.jpg
Obama Supreme Court immigration ruling_00000000.jpg
Now playing
01:16
Obama responds to immigration ruling
The U.S. Supreme Court is shown as the court meets to issue decisions May 23, 2016 in Washington, D.C.
PHOTO: Win McNamee/Getty Images
The U.S. Supreme Court is shown as the court meets to issue decisions May 23, 2016 in Washington, D.C.
Now playing
01:11
Supreme Court upholds affirmative action at university
WASHINGTON, DC - JUNE 25: A gay marriage waves a flag in front of the Supreme Court Building June 25, 2015 in Washington, DC. The high court is expected rule in the next few days on whether states can prohibit same sex marriage, as 13 states currently do. (Photo by Mark Wilson/Getty Images)
PHOTO: Mark Wilson/Getty Images
WASHINGTON, DC - JUNE 25: A gay marriage waves a flag in front of the Supreme Court Building June 25, 2015 in Washington, DC. The high court is expected rule in the next few days on whether states can prohibit same sex marriage, as 13 states currently do. (Photo by Mark Wilson/Getty Images)
Now playing
01:36
GOP hopefuls denounce marriage ruling
The Justices of the US Supreme Court sit for their official photograph on October 8, 2010 at the Supreme Court in Washington, DC. Front row (L-R): Associate Justice Clarence Thomas, Associate Justice Antonin Scalia, Chief Justice John G. Roberts, Associate Justice Anthony M. Kennedy and Associate Justice Ruth Bader Ginsburg. Back Row (L-R): Associate Justice Sonia Sotomayor, Associate Justice Stephen Breyer, Associate Justice Samuel Alito Jr. and Associate Justice Elena Kagan. AFP PHOTO / TIM SLOAN (Photo credit should read TIM SLOAN/AFP/Getty Images)
PHOTO: TIM SLOAN/AFP/Getty Images
The Justices of the US Supreme Court sit for their official photograph on October 8, 2010 at the Supreme Court in Washington, DC. Front row (L-R): Associate Justice Clarence Thomas, Associate Justice Antonin Scalia, Chief Justice John G. Roberts, Associate Justice Anthony M. Kennedy and Associate Justice Ruth Bader Ginsburg. Back Row (L-R): Associate Justice Sonia Sotomayor, Associate Justice Stephen Breyer, Associate Justice Samuel Alito Jr. and Associate Justice Elena Kagan. AFP PHOTO / TIM SLOAN (Photo credit should read TIM SLOAN/AFP/Getty Images)
Now playing
01:21
Supreme Court rules on EPA emissions limits
The U.S. Supreme Court is shown March 29, 2016 in Washington, DC following the first 4-4 tie in a case before the court.
PHOTO: Win McNamee/Getty Images
The U.S. Supreme Court is shown March 29, 2016 in Washington, DC following the first 4-4 tie in a case before the court.
Now playing
01:09
Supreme Court rules 7-1 in favor of death row inmate
A general view of the US Supreme Court in Washington, DC, June 18, 2015. AFP PHOTO/JIM WATSON (Photo credit should read JIM WATSON/AFP/Getty Images)Supreme Court building exterior
PHOTO: JIM WATSON/AFP/Getty Images
A general view of the US Supreme Court in Washington, DC, June 18, 2015. AFP PHOTO/JIM WATSON (Photo credit should read JIM WATSON/AFP/Getty Images)Supreme Court building exterior
Now playing
01:37
Supreme Court rules in favor of lethal injection drug
WASHINGTON, DC - MARCH 26: The exterior of the U.S. Supreme Court on March 26, 2012 in Washington, DC. Today the high court, which has set aside six hours over three days, will hear arguments over the constitutionality President Barack Obama's Patient Protection and Affordable Care Act. (Photo by Mark Wilson/Getty Images)
PHOTO: Getty Images
WASHINGTON, DC - MARCH 26: The exterior of the U.S. Supreme Court on March 26, 2012 in Washington, DC. Today the high court, which has set aside six hours over three days, will hear arguments over the constitutionality President Barack Obama's Patient Protection and Affordable Care Act. (Photo by Mark Wilson/Getty Images)
Now playing
01:14
Supreme Court rules on congressional districting
(CNN) —  

The Supreme Court sided Tuesday with faith-based pregnancy centers in California in a case that pitted abortion rights against free speech.

The ruling was 5-4.

In the majority opinion, Justice Clarence Thomas wrote the law “unduly burdens protected speech.”

The California Reproductive Freedom, Accountability, Comprehensive Care, and Transparency Act requires licensed clinics, which provide services like ultrasounds, to disseminate a notice stating that California has programs providing “immediate, free or low-cost access” to comprehensive family planning services including abortion.

The law also requires unlicensed clinics – those that provide resources such as vitamins and diapers but have no medical providers on site – to disseminate a notice that they are not licensed by the state. Religiously affiliated pregnancy centers say the law forces them to deliver a message that is both detrimental to their cause and in direct conflict with their mission to encourage childbirth.

Justice Anthony Kennedy stressed the free speech rights of those centers in a fiery concurring opinion

“Governments must not be allowed to force persons to express a message contrary to their deepest convictions. Freedom of speech secures freedom of thought and belief. This law imperils those liberties,” he wrote.

“It is forward thinking to begin by reading the First Amendment as ratified in 1791; to understand the history of authoritarian government as the Founders then knew it; to confirm that history since then shows how relentless authoritarian regimes are in their attempts to stifle free speech; and to carry those lessons onward as we seek to preserve and teach the necessity of freedom of speech for the generations to come.”

But Justice Stephen Breyer warned in a dissenting opinion, that “using the First Amendment to strike down economic and social laws that legislatures long would have thought themselves free to enact will, for the American public, obscure, not clarify, the true value of protecting freedom of speech.”

Overturns 9th Circuit

The 9th US Circuit Court of Appeals said California has a substantial interest in “ensuring that its citizens have access to and adequate information about constitutionally protected medical services like abortion.”

The clinics, represented by the conservative Alliance Defending Freedom, said the court used too lax a standard when reviewing the law.

Supporters of the law – including groups such as the Center for Reproductive Rights and Planned Parenthood – said it was necessary because some clinics tried to disguise the fact that they oppose abortion.