Twitter has long defended its users' rights to free expression - a position it has held for years, notably during the widespread "Arab Spring" protests in 2011.
DHS spokeswoman Jenny Burke told us the department doesn't comment on pending litigation as a matter of policy.
Twitter argues in the suit that the request is a threat to free speech, which includes "a right to disseminate such anonymous or pseudonymous political speech". The account described its users to The Associated Press in February as employees and former employees of the agency.
The American Civil Liberties Union said it was representing the anonymous Twitter user, who has 33,000 followers, and would be filing on the user's behalf soon.
Twitter defied a US government request for records that could identify users behind an account opposed to President Donald Trump account, and is challenging the order in court. A representative for the Department of Homeland Security did not immediately respond to a request for comment. Its Twitter feed has publicly criticized the administration's immigration policies, particularly the actions of the U.S. Citizenship and Immigration Services (USCIS) division of Homeland Security.
For weeks the account has posted criticism of the administration.
Suspects in abetting terrorism arrested in St. Petersburg
The remains of Akbarzhon Dzhalilov, 22, were recovered from the scene of the bombing, Russian authorities said on Tuesday. The bomb went off on a train under Russia's second-largest city on Monday.
Twitter, which counts Trump among its active users, has a record of litigating in favour of user privacy.
Twitter says the administration demanded they release private information about the account a month ago. And the Court has likewise recognized that anonymity is often essential to fostering such political speech where, as here, the speaker could face retaliation or retribution if his or her real identity were linked to the speech.
The order said it was "in connection with an investigation or inquiry to ascertain the correctness of entries, to determine the liability for duties, taxes, fines, penalties, or forfeitures, and/or to ensure compliance with the laws or regulations".
The lawsuit may also be savvy public relations for Twitter, said Jane Kirtley, law and journalism professor at the University of Minnesota.
The ACLU's national Twitter account tweeted its support for the social media site Thursday.
The social media company has a history of challenging other government demands for information on its users, including a 2012 demand from NY prosecutors about an Occupy Wall Street protester.