Uncovering and explaining how our digital world is changing — and changing us.

Twitter is suing the Trump administration after it tried to compel the social media site to reveal the identity of an account that had been tweeting criticism of the president.

In a lawsuit filed in the U.S. District Court in the Northern District of California, Twitter revealed that the Department of Homeland Security in March had demanded that the company reveal who is behind @ALT_USCIS, an anonymous account that has been raising alarms about U.S. Citizenship and Immigration Services and Trump’s immigration policies.

Twitter contends the request amounts to an “unlawful” use of the government’s investigative powers, as the rules that allow customs and border officials to issue summonses generally relate to the import of merchandise, including counterfeit goods — not information involving online accounts.

In seeking to unmask that user anyway, though, Twitter says the government’s request “would have a grave chilling effect on the speech of that account in particular and on the many other ‘alternative agency’ accounts that have been created to voice dissent to government policies.”

A spokesman for DHS declined to comment, citing the fact it is pending litigation. Spokespeople for the Justice Department and White House also declined to offer their views on the case.

But Democratic Sen. Ron Wyden, an ally of Silicon Valley in Congress, blasted the Trump administration Thursday for its conduct. “The Department of Homeland Security appears to have abused its authority and wasted taxpayer resources, all to uncover an anonymous critic on Twitter,” the Oregon lawmaker told Recode in a statement. He said the agency’s inspector general -- a watchdog that reviews for abuse — should “investigate to determine who directed this witch hunt.”

Since Trump has taken office, a number of “alt-agency” accounts — unofficial deviations from federal agencies’ verified online Twitter profiles — have started firing 140-character salvos at the new administration.

There are accounts for the Environmental Protection Agency and the Labor Department, for example, which have targeted Trump for his climate and employment policies. Some “rogue” staffers at the National Park Service even hijacked their official account to tweet criticism of the president around his inauguration, though NPS quickly reclaimed it.

In many cases, though, the authors of these accounts are not clear. “The users appear to view and depend on preservation of their anonymity as crucial to their ability to express information and ideas that are contrary to the policies and objectives of the Administration and its agencies,” as Twitter explains in its court briefing.

The @ALT_USCIS account arrived in late January, according to Twitter’s complaint, purporting to be the site of the “[o]fficial inside resistance” of USCIS. It began tweeting sharp rebukes of Trump’s immigration policies, including his support for a wall along the U.S.-Mexican border. And it soon alleged rampant mismanagement at the USCIS, pointing out a potential instance of lost green cards and poor behavior by customs agents.

On March 14, Twitter said an agent for the USCIS “transmitted to Twitter by fax a summons” that ordered it to produce records related to the alt-agency account. That information included names, addresses and phone numbers, Twitter said, along with a threat of additional sanctions if the company did not comply.

In the days to follow, Twitter said it informed the @ALT_USCIS accountholder of the government’s request — and the Trump administration of its plans to challenge the summons in court.

And on Thursday, the @ALT_USCIS also fired back:

Twitter has a long history of defending free speech on its platform, sometimes to a fault (hence its issues around abuse and harassment). Late last year, Twitter reminded everyone that it’s against the company’s guidelines to use Twitter for surveillance purposes, claiming a “commitment to social justice is core to our mission.”

Additional reporting by Kurt Wagner.

Sign up for the newsletter Recode Daily Email (required) By signing up, you agree to our Privacy Notice and European users agree to the data transfer policy. Subscribe