BALTIMORE (CN) — The Fourth Circuit ruled 2-1 Thursday that Baltimore cannot buy the silence of victims of police brutality with legal settlements that include a nondisparagement clause.

The lawsuit began in 2012 when Ashley Overbey, a 25-year-old black woman, called police to report a burglary. Two officers beat her up and arrested her, and after those charges were dropped she sued and settled for $63,000.

Overbey’s story was featured in a 2014 Baltimore Sun article about the city’s excessive-force settlements, and when Overbey defended herself from racist trolls commenting on the newspaper’s now-shuttered online public comment forum, the city withheld half her settlement for violating the nondisparagement clause.

Joined by the Baltimore Brew, a web-based news outlet, and represented by the ACLU and lawyers from the Washington, D.C., firm of Crowell & Moring, Overbey sued the city again in 2017 to get her missing $31,500. A federal judge dismissed her claim, but on Thursday the Fourth Circuit reversed.

“We hold that the non-disparagement clause in Overbey’s settlement agreement amounts to a waiver of her First Amendment rights and that strong public interests rooted in the First Amendment make it unenforceable and void,” U.S. Circuit Judge Henry Floyd wrote, joined by Judge Stephanie Thacker. Judge Marvin Quattlebaum dissented.

The city’s argument — that Overbey was merely exercising her right to refrain from speech in exchange for money — turns previous free speech precedent on its head, the majority ruled.

“At its heart, the right to refrain from speaking is concerned with preventing the government from compelling individuals to mouth support for views they find objectionable,” Floyd wrote, citing the 1988 U.S. Supreme Court decision Riley v. Nat’l Fed’n of the Blind of N. Carolina, Inc.

“Overbey’s promise not to speak about her case cannot be fairly characterized as an exercise of her right to refrain from speaking, because none of the interests protected by the right to refrain from speaking were ever at stake in the case.”

The majority applied a two-part test to the gag order: Did Overbey agree to it voluntarily? And is the interest in enforcing the waiver outweighed by relevant public policy that would be harmed by its enforcement?

On the second point, Floyd said the city had not met its burden to prove that enforcing the gag order did not harm the public interest.

“The city cannot succeed merely by invoking its general interest in settling lawsuits,” Floyd wrote. “It must point to additional interests that, under the circumstances, justify enforcing Overbey’s waiver of her First Amendment rights.”

The city claimed the officers Overbey sued had an interest in “clearing their names” and that the government’s interest in avoiding “harmful publicity” weighed in their favor. But Floyd wrote that while he was “not unsympathetic to” concerns for the officers’ reputations, that the city’s interest in avoiding harmful publicity goes directly to the core of why the gag orders are not enforceable.

“It is well-established that vehement, caustic and sometimes unpleasantly sharp attacks on government and public officials can play a valuable role in civic life,” the judge wrote, quoting from a foundational First Amendment case, New York Times v. Sullivan.

Finally, the city appealed to fairness, saying that Overbey “sold her [speech] rights. With an option to buy them back, which she exercised and now she has them again.”

But Floyd wrote: “When the second half of Overbey’s settlement sum is viewed in this light, it’s difficult to see what distinguishes it from hush money. Needless to say, this does not work in the city’s favor.”

Overbey, now known as Ashley Overbey Underwood, said in a statement: “I stood up for what’s right and I am absolutely ecstatic about this ruling in favor of the people and their free speech rights. People should be able to tell their stories and defend themselves when they are seeking justice, especially when the city gets to tell their side. It gives me hope that we can see change for people and movement for police reform.”

Deborah Jeon, legal director for the ACLU of Maryland, called the ruling “a home run for the First Amendment, which is especially important in this cutting-edge case at the intersection between free speech and racial justice.”

The circuit also ruled that the Baltimore Brew, an online news publisher, does have standing in the case, which was remanded.

A long list of newspapers, news organizations and universities submitted amici briefs.