An Iowa man threatened by city officials for posting on his website that his hometown smelled like “rancid dog food” won a free-speech lawsuit this week, according to new reports.

Josh Harms, who runs the “Should You Move to Sibley, Iowa?” website, filed suit in U.S. District Court earlier this month asking a judge to block the city’s officials from suing him, ABC News reported.

Harms, 28, who was represented by the American Civil Liberties Union, rose to victory Thursday when a federal district court issued a permanent injunction — ordering officials to refrain from suing or threatening to sue him, according to the report.

Harms had used his website to criticize the town’s odor problem — which stems for Iowa Drying and Processing, a plant that manufactures a high-protein animal food supplement from pig blood, according to the report.

The plant moved to Sibley in 2013, and Harms began publishing his website in 2015. Earlier versions of the website urged visitors not to move to Sibley until city officials addressed the “horrible rotten-blood and stale-beer odor that hangs over the town,” The Des Moines Register reported.

This past December, Daniel DeKoter, the attorney for the city of Sibley, sent Harms a letter saying the website’s content was hurting the community — and ordered him to take it down in 10 days or face legal action, ABC reported.

But now, the city must provide First Amendment training to its staff, issue a written apology to Harms, cover $20,475 in attorney’s fees for the time the ACLU and its cooperating attorney spent on Harms’ case, and pay $6,500 in damages to Harms, according to The Des Moines Register.

“I’m happy that the city of Sibley has recognized they were wrong to threaten me for the criticism I’ve written and published online,” Harms told the paper. “Personally disagreeing with something that’s been written is understandable, but threatening the writer with a lawsuit while representing the government is censorship. It violates the First Amendment and our freedom of speech.”

Rita Bettis, legal director for the ACLU of Iowa, said Harms’ victory “sends a strong message to the city of Sibley and all Iowa government officials to respect the free speech rights of Iowans.”

“The right of the people to freely and openly criticize their government is the very foundation of democracy,” she added.

As of Friday morning, Harms’ website did not include any commentary about the Sibley’s odor — but a message at the top of the page said it would be updated soon.

“With the injunction secured, I plan to continue using my skills as a web developer to help improve the lives of everyone living here by calling attention to the problems that we face,” Harms wrote.