“It is very surprising that this kind of order would be issued without being heard,” Ms. Sager said. “We were never given notice. We don’t know what was said. We hear speculative threats, we hear these safety allegations all the time. Courts have said that’s not enough. There has to be a clear threat, and the example is troop movements during wartime — it has to rise to that level.”

Ms. Sager said she was confident an appeals court would vacate the judge’s order.

“The Supreme Court has ruled over and over again, the press can publish the information it has lawfully obtained if it is of public concern and interest,” said Ted Boutrous, a First Amendment lawyer who has represented the newspaper in the past but is not involved with this case. “It’s extraordinarily unusual for something to be de-published, and in some ways it is worse than prior restraint. It plainly violates the First Amendment.”

Judges have issued similar orders before, instructing news outlets not to use court documents that were made public in error, said Bruce Brown, the executive director of the Reporters Committee for Freedom of the Press. But in every case, he said, the order has ultimately been overturned.

“For a court to say something that was put in a public file by mistake from a clerk or a court cannot be published would be putting 90 years of constitutional law on its head,” Mr. Brown said. “The judges get frustrated because these mistakes are under their own docket, but nothing can be more clear. But mistakes get made, and it will happen again.”