LOUISVILLE, Ky. (AP) — A federal district court has ruled in favor of a Kentucky wedding photographer who challenged a Louisville ordinance banning businesses from discriminating against gay customers.

U.S. District Court Judge Benjamin Beaton on Tuesday granted a request by Chelsey Nelson for an injunction against the city’s ordinance, the Courier Journal reported. The order said the city could not use the law to compel her to photograph same-sex weddings or “otherwise express messages inconsistent with Nelson’s beliefs.”

Nelson sued Louisville city officials in 2019 – arguing that the city’s so-called fairness ordinance violated the First Amendment because it could force her to take on same-sex wedding assignments, which she opposes due to her religious beliefs. The Louisville ordinance prohibits discrimination based on sexual orientation and gender identity in housing, public accommodations and employment.

Alliance Defending Freedom attorney Bryan Neihart said in the statement Wednesday that he was happy with the court’s decision.

“We’re pleased the court agreed that the city violated Chelsey’s First Amendment rights. The court’s decision sends a clear and necessary message to every Kentuckian — and American — that each of us is free to speak and work according to our deeply held beliefs,” Neihart said.

Louisville Mayor Greg Fischer said in a statement that he disagreed with the court’s ruling and that city officials would likely appeal.

“We are a city of compassion and we appreciate the many ways our LGBTQ+ family contributes to our diverse community,” Fischer said. “Louisville Metro Government will continue to enforce to the fullest extent possible its ordinance prohibiting anti-discriminatory practices and will fight against discrimination in any form.”