RICHMOND, Virginia — A Baltimore law that required an anti-abortion pregnancy counseling center to post disclaimers in its waiting room is unconstitutional, a federal appeals court ruled Friday.

The 4th U.S. Circuit Court of Appeals found that the Baltimore ordinance violates the First Amendment rights of the Greater Baltimore Center for Pregnancy Concerns, a nonprofit Christian organization that counsels women on alternatives to abortion.

The law requires pregnancy counseling centers to post signs saying they do not provide or make referrals for abortions or birth control. The city’s lawyers argued that the law was aimed at reining in what it viewed as deceptive practices and to prevent health risks that can arise from delaying an abortion.

The 4th Circuit upheld a 2016 ruling by a U.S. District Court judge, finding that despite seven years of litigation over the 2009 law, the city has not identified a single example of a woman who walked into the center’s waiting room believing that she could obtain an abortion there.

The court found that the law compelled “a politically and religiously motivated group to convey a message fundamentally at odds with its core belief and mission.”

“This court has in the past struck down attempts to compel speech from abortion providers. And today we do the same with regard to compelling speech from abortion foes. We do so in the belief that earnest advocates on all sides of this issue should not be forced by the state into a corner and required essentially to renounce and forswear what they have come as a matter of deepest conviction to believe,” Judge J. Harvie Wilkinson III wrote for the three-judge panel.

Tom Schetelich, chairman of the board of the center, called the ruling “a victory for the First Amendment and for the women of Baltimore.”

Attorney Suzanne Sangree, a lawyer for the city of Baltimore, did not immediately return calls seeking comment on the ruling.