WikiLeaks founder Julian Assange is taken from court in London on May 1. (Matt Dunham/AP)

FOR ONCE, the Trump administration seemed to be taking the smart, careful route. Instead of indicting WikiLeaks provocateur Julian Assange for journalistic activities, such as publishing government secrets, the Justice Department charged him for allegedly helping now-former Army soldier Chelsea Manning hack into a government database and steal the secrets he sought to publish. If it succeeded in court, the federal government could have locked up Mr. Assange for years without challenging the First Amendment, chilling reporters’ activities or discouraging the British government, which is holding Mr. Assange, from extraditing him to the United States rather than to Sweden, where he faces a rape investigation.

Then, on Thursday, the Justice Department’s National Security Division threw smart and careful out the window, indicting Mr. Assange on 17 counts of violating the Espionage Act, a 1917 law that is likely unconstitutional in its potential application to journalists’ work. The charges relate to obtaining and publishing sensitive information. National Security Division chief John Demers explained Thursday that “the department takes seriously the role of journalists in our democracy,” and that “it has not and never has been the department’s policy to target them for reporting.” But, he said, “Julian Assange is no journalist.”

We don’t believe Mr. Assange’s activities qualify as journalism, but the legal theory used against him could easily be applied to journalists. According to reporters present at a Justice Department briefing, government officials refused to explain how the activities for which Mr. Assange is now being charged differ from those investigative journalists use daily. There is too little distinction for comfort. Reporters often seek out and publish secret information from sources who are not authorized to reveal it. Sometimes news organizations decline to publish some of the information they gather, out of concern that it could put government sources at risk or endanger public safety. Other times, news organizations’ assessment of the risks differs from the government’s, and publication proceeds despite officials’ objections. Without the freedom to do this work, some of the gravest government misdeeds would never have come to light.

The Obama administration sadly helped pave the way for this turn of events. The Obama Justice Department used the Espionage Act in an attempt to extract information from a Fox News reporter about a State Department leak, setting an unfortunate precedent for using a bad law to harass journalists. But even the Obama Justice Department chose not to charge Mr. Assange under the legal theory the Trump administration is now using out of concern about chilling press activities.

The Espionage Act itself is a vaguely worded and dangerous relic. If the Obama administration’s abuse of the law was not enough to persuade lawmakers to reconsider the law, the Trump administration’s should be.