A federal judge on Friday issued an injunction forcing the city of East Lansing, Michigan to allow a farmer opposed to same-sex marriage to return to its outdoor market.

Stephen Tennes' The Country Mill farm in Eaton County is a popular wedding venue. In a Facebook post in December, Tennes said that he reserves the right to refuse to host the weddings of gay and lesbian couples.

The city responded by barring Tennes from its market, saying that he had violated its civil rights ordinance, which prohibits discrimination based on sexual orientation. Tennes filed a lawsuit in May, saying that his rights to free speech and religion are being violated. Tennes is represented by the Washington-based Alliance Defending Freedom (ADF).

In his 16-page ruling, U.S. District Judge Paul Maloney sided with Tennes, saying that his Facebook posts announcing his policy “constitute protected activity” under the First Amendment.

“The City focuses on the act of excluding same-sex wedding ceremonies from Country Mill,” wrote Maloney, an appointee of George W. Bush. “But, even if that conduct is not protected, Plaintiffs still engaged in protected activity when Tennes communicated his religious beliefs on Facebook in August and December. Even if the City is correct that talking about discrimination is not protected, Plaintiffs also talked about their religious beliefs, which is a protected activity. For the first element in the retaliation claim the City cannot ignore the portions of the Facebook posts that would be protected speech.”

Maloney also found that the city had violated Tennes' freedom of religion.

“A factfinder could infer that the change in the Vendor Guidelines was motivated by Plaintiffs’ religious beliefs or their religiously-motivated conduct. And, the City’s hostility to Plaintiffs’ religion or religious conduct was then manifested when the City used its facially neutral and generally applicable ordinance to deny Plaintiffs’ Vendor Application,” he wrote.

In a Facebook post, Tennes said that he was “thrilled” with the decision that allows him to return to the East Lansing Farmer's Market.

The city called the ruling “disappointing” and said that it was considering seeking an appeal.