Two years ago, Denver’s city attorney persuaded a federal judge to dismiss the city and its police chief as defendants in a civil rights lawsuit. This week, they were declared in contempt of court and ordered to pay attorneys’ fees in the case.

In a ruling issued Thursday, U.S. District Court Judge William J. Martinez found the city had failed to educate its police officers about a federal court injunction that allowed protests, pamphleteering and other public demonstrations in front of the Lindsey-Flanigan Courthouse on West Colfax Avenue.

Martinez also dissolved the injunction that had banned the city or court system from enforcing rules that limit protests and dismissed the lawsuit. That decision allows the 2nd Judicial District to impose restrictions on where people can stand to hold signs, march and pass out brochures.

As a result of the decision, the city may again owe money to David Lane, a Denver civil rights attorney who frequently sues the city. Lane must file a motion to claim his fees, the judge’s order said, so the potential amount owed is unknown.

City attorneys were not available for comment Friday. They can appeal the contempt order.

The city and Police Chief Robert White were dismissed as defendants in 2015 when the city attorney sided with the plaintiffs, declaring the courthouse plaza as a free-speech zone.

Court observers said Martinez’s Thursday ruling was an unusual twist.

“I don’t know if I’ve ever seen anything like this,” said Christopher Jackson, a former assistant attorney general in Colorado who now works at Sherman & Howard law firm.

The judge’s statements indicate he was not pleased with the way Denver handled the issue, said Jackson, who was not involved with either case. “They definitely didn’t come out ahead, and the court nailed them for it,” he said.

The legal battle started in summer 2015 when activists were handing out brochures about jury nullification in front of the courthouse. It escalated into a turf war between the activists and the city and the 2nd Judicial District.

Then-District Attorney Mitch Morrissey charged two people with jury tampering, charges later dismissed. The arrests led Eric Verlo, Janet Matzen and the Fully Informed Jury Association to file a lawsuit against the city and White. The 2nd Judicial District chief judge was added as a defendant after he issued an order to ban protests outside the courthouse in anticipation of a verdict in a death penalty case.

But Martinez ordered an injunction, barring the city or the courts from enforcing the protest ban, after the city argued on behalf of Verlo, Matzen and the jury association

However, the city reversed its stance in February, under the leadership of City Attorney Kristin Bronson, who was appointed last year. In a status report to the court, the city and the 2nd Judicial District announced that they intended to sign a memorandum of understanding to create a joint security policy for the courthouse grounds. The Lindsey-Flanigan property is owned by the city but managed by the court system.

In his order, Martinez scolded Denver for changing its position, saying the city was “attempting both to have and eat its cake.” He accused the city of being more concerned about saving money by avoiding a long legal battle than defending First Amendment rights. He also wrote that the court “looks forward to whatever verbal gymnastics” the city will present when it attempts to explain itself.

“Ever since Denver realigned itself with the 2nd Judicial District, the Court has been somewhat confused about Denver’s actual position in this litigation,” Martinez wrote.

The city wasn’t the only target of Martinez’s scorn. He also took the protesters to task for abusing the freedom of expression granted in his original injunction.

“This problematic behavior on the part of plaintiffs and their allies was frequently needlessly combative, aggressively intimidating, gratuitously vulgar and intentionally disruptive — often with no apparent purpose or point other than to flaunt the supposed right to be combative, intimidating, vulgar and disruptive,” the order said.

Lane took offense to that characterization of his clients. There was no evidence they acted inappropriately, he said; rather, it was others who showed up as the turf war escalated who acted out.

“The judge owes them an apology, frankly,” Lane said.