In a scathing criticism of FanX’s founders and legal team, a federal judge has ruled that the organizers of the former Salt Lake Comic Con must pay nearly $4 million in attorney fees and costs to San Diego Comic-Con after losing a trademark-infringement case.

In an order filed Thursday, U.S. District Judge Anthony Battaglia ordered Dan Farr Productions LLC, the company that stages Salt Lake City’s annual pop-culture convention, and FanX founders Dan Farr and Bryan Brandenburg to pay $3,962,486.84 to San Diego Comic-Con for attorney fees and expert costs in the 4-year-old lawsuit.

Battaglia also declared that FanX Salt Lake Comic Convention must stop using the phrase “formerly known as Salt Lake Comic Con” in advertising and social media, and can no longer use its old website domain, saltlakecomiccon.com, to link to its current one, fanxsaltlake.com. The judge gave FanX 30 days to comply with that ruling, so FanX can still use the phrase and domain through this year’s convention, set for Sept. 6 through 8 at the Salt Palace Convention Center.

In a statement Friday, Farr and Brandenburg vowed to appeal the jury’s verdict and the judge’s ruling on the fees.

“We do not expect a $4 million attorney fee award predicated on a $20,000 jury verdict to survive appellate review,” they wrote. “We have instructed our attorneys to begin working on an appeal to the 9th Circuit [Court of Appeals] — while we prepare for what we expect to be our best event ever, starting September 6.”

A jury in December ruled that Dan Farr Productions violated San Diego Comic-Con’s trademark when it named its event Salt Lake Comic Con. The jury found that it wasn’t a “willful infringement” and awarded $20,000 in damages to the San Diego event.

Attorney fees are rarely awarded in trademark lawsuits, except in “exceptional cases.” Battaglia’s order said this was “exceptional,” a case “that stands out from others based on the unreasonable manner in which it was litigated,” he wrote.

That unreasonable litigation, Battaglia added, came from FanX’s side.

In a 37-page order, Battaglia calls out Dan Farr Productions’ legal team for arguments he called “nonsensical,” “hodgepodge” and “legally irrelevant.” He criticized the “wasteful litigation tactic” of repeatedly raising issues on which Battaglia had already ruled.

At one point, Battaglia decries Dan Farr Productions’ “‘head in the sand’ litigation strategies that has resulted in this Court repeatedly re-analyzing the same arguments. … Ultimately, like a broken record, DFP has repetitively restated and rehashed several contentions that they were unable to advance successfully prior to trial.”

The order also says DFP’s lawyers committed “clear misconduct” by playing to the jury’s bias in mentioning San Diego Comic-Con’s size and financial success. Battaglia also admonished DFP’s legal team for violating the court’s “Golden Rule” by improperly asking jurors to put themselves in the place of Farr and Brandenburg.

Battaglia’s order chides Brandenburg for breaking court rules in divulging confidential information on Twitter and his social media accounts. He also said Brandenburg’s efforts to reject San Diego Comic-Con’s original cease-and-desist letter, and taking the argument to the media, were “objectively irrational.”

In other rulings Thursday, Battaglia denied FanX’s motion for a new trial and rejected a request to delay entry of his judgment until after this year’s convention.

It wasn’t all bad news for FanX, though. Battaglia denied San Diego Comic-Con’s new-trial request, in which the San Diego event argued against the jury’s ruling that FanX’s infringement wasn’t “willful.” The judge also said FanX doesn’t have to destroy old merchandise and items with the Salt Lake Comic Con name, as long as they are for the company’s “historical archive” — and not sold or otherwise distributed. And FanX still can use the words “comic convention” in its full name.

FanX even caught a slight break on attorney fees. San Diego Comic-Con sought nearly $5 million in lawyer fees and costs, plus $243,833.06 for expert witnesses. The judge pared that to just over $3.76 million for attorneys and $212,323.56 for the experts.

San Diego Comic-Con’s lawsuit against the Salt Lake City event is seen as a test case. San Diego organizers have asserted their trademark against other cities' conventions that use variations of the “comic con” name.