A federal court ordered a permanent halt in enforcement of an Arizona law that aimed to combat so-called “revenge porn” on Friday. The 2014 law was challenged in court by the American Civil Liberties Union, which represented a coalition of media interests. The suit contended the law was too broad and had the potential to encompass a range of other nude images from being published that have an intended artistic or newsworthy value.

Revenge porn is generally understood to be an intentionally malicious act in which easily identifiable nude photographs of former lovers are posted online. The Arizona law would have made it possible for people posting nude photographs to be charged with felonies, even if there was no harm intended and the photographs were not private.

“This is a complete victory for publishers, booksellers, librarians, photographers, and others against an unconstitutional law,” said David Horowitz, the executive director of Media Coalition, an association that defends first amendment rights for media interests, in a press release. “Now they won't have to worry about being charged with a felony for offering newsworthy and artistic images.”

There are 24 states that have criminal revenge-porn laws on the books, according to a list updated Thursday by the Brooklyn law firm C.A. Goldberg, which focuses on Internet privacy and abuse, sexual consent and domestic violence cases.

Arizona’s revenge-porn law was blocked in 2014 soon after it was passed, after the ACLU filed its motion citing, among other examples, a Pulitzer Prize-winning Vietnam war photo that shows a little nude girl running down a road in Vietnam. The girl was running from her village where South Vietnamese planes had accidentally dropped napalm bombs. Her clothes had been burned off.

Under the Arizona revenge-porn law, a publisher or even a librarian, could be charged with a felony for that photograph, opponents alleged.

“This is an important vindication of the First Amendment and a great resolution for our clients,” said ACLU Staff Attorney Lee Rowland in the release. “We commend the state for agreeing not to enforce a broad statute that chilled and criminalized speech unquestionably protected by the Constitution.”