Seamus Hughes, a terrorism expert at George Washington University who closely tracks court cases, uncovered the filing and posted it on Twitter.

A Justice Department spokesman declined to say on Thursday what led to the inadvertent disclosure. It was made in a recently unsealed filing in an apparently unrelated sex-crimes case charging a man named Seitu Sulayman Kokayi with coercing and enticing an underage person to engage in unlawful sexual activity. Mr. Kokayi was charged in early August, and on Aug. 22, prosecutors filed a three-page document laying out boilerplate arguments for why his case at that time needed to remain sealed.

While the filing started out referencing Mr. Kokayi, federal prosecutors abruptly switched on its second page to discussing the fact that someone named “Assange” had been secretly charged, and went on to make clear that this person was the subject of significant publicity, lived abroad and would need to be extradited — suggesting that prosecutors had inadvertently pasted text from a similar court filing into the wrong document and then filed it.

“Another procedure short of sealing will not adequately protect the needs of law enforcement at this time because, due to the sophistication of the defendant and the publicity surrounding the case, no other procedure is likely to keep confidential the fact that Assange has been charged,” prosecutors wrote.

They added, “The complaint, supporting affidavit, and arrest warrant, as well as this motion and the proposed order, would need to remain sealed until Assange is arrested in connection with the charges in the criminal complaint and can therefore no longer evade or avoid arrest and extradition in this matter.”

The Justice Department has been studying how to charge Mr. Assange or WikiLeaks with some kind of criminal offense since the site began publishing its trove of secret military and diplomatic documents. Prosecutors, for example, toyed with the idea of charging Mr. Assange as a conspirator in Ms. Manning’s crime of unauthorized disclosure of secrets related to national defense. And it eventually became public that a grand jury in the Eastern District of Virginia was investigating people with links to WikiLeaks.

But even as the Obama administration brought criminal charges in an unprecedented number of leak-related cases, it apparently held back from charging Mr. Assange. Members of the Obama legal policy team from that era have said that they did not want to establish a precedent that could chill investigative reporting about national security matters by treating it as a crime.