(Reuters) - A federal appeals court on Friday declared unconstitutional a Baltimore law requiring pregnancy clinics that do not offer or refer women for abortions to post signs disclosing that fact in their waiting rooms.

The 4th U.S. Circuit Court of Appeals ruled 3-0 that the law violated the First Amendment free speech rights of the Greater Baltimore Center for Pregnancy Concerns, a Christian nonprofit that provides prenatal services and counsels women on abortion alternatives.

Friday’s decision in the nearly eight-year-old case followed dozens of court submissions from abortion rights, anti-abortion and religious freedom advocates, and came as the U.S. Supreme Court prepares to consider a similar case from California.

Maryland’s largest city had argued that its 2009 law was meant to address deceptive advertising and reduce the potential health risks from waiting too long to have an abortion.

Circuit Judge J. Harvie Wilkinson III, however, wrote for the Richmond, Virginia-based appeals court that Baltimore’s approach amounted to “too loose a fit” with those ends.

“The ordinance forces the center to utter in its own waiting room words at odds with its foundational beliefs and with the principles of those who have given their working lives to it,” he wrote. “Without proving the inefficacy of less restrictive alternatives, providing concrete evidence of deception, or more precisely targeting its regulation, the city cannot prevail.”

Friday’s decision upheld an October 2016 ruling by U.S. District Judge Marvin Garbis in Baltimore.

“This court ruling means that we can do our job and the government can’t tell us what to say or how to say it,” the clinic’s executive director Carol Clews said in a statement.

Ten U.S. states with Republican attorneys general supported the clinic.

Suzanne Sangree, a lawyer who argued Baltimore’s appeal, said the city was disappointed, and may appeal to the Supreme Court and perhaps also submit a brief in the California case.

In that case, the Supreme Court is expected by June to decide whether California violates the free speech rights of private “crisis pregnancy centers” opposed to abortion by requiring signs about how to obtain state-sponsored services including abortion and contraception.

California Attorney General Xavier Becerra, a Democrat, has said the law, upheld by a federal appeals court in San Francisco in October 2016, helps inform women about their options.

Wilkinson called the California disclaimer “markedly different” from Baltimore’s, and said a separate requirement that unlicensed clinics disclose their lack of licensing does not mention abortion.

The case is Greater Baltimore Center for Pregnancy Concerns Inc v Mayor and City Council of Baltimore et al, 4th U.S. Circuit Court of Appeals, No. 16-2325.