Twitter filed a federal lawsuit to stop an order by the US government to know who is behind President Donald Trump's immigration policies.

Trump has promised to build a wall along the border with Mexico and to deport millions of illegal immigrants. The social media firm cited freedom of speech as its basis for not turning over the records.

The Twitter account US CIS refers to U.S. Citizenship and Immigration Services which describes itself as "immigration resistance." Since January, there have been feeds that borrowed the names and logos of government agencies which challenge the views of the president. They are called the "alt" accounts. The @ALT_uscis currently has more than 40,000 followers according to CNN. However, after the lawsuit became public, it has increased to 89,000.

The lawsuit states that an agent of the US Customs and Border Protection (CBP) faxed a summon to Twitter to request an account login, phone number, mailing address and IP address of the account concerned. However, the summon did not state that Twitter should keep the document private. The CBP agent concerned have not yet issued a statement on the matter.

Nick Pacilio, a Twitter spokesman, declined to comment whether the government had demanded information of other anti-Trump accounts. However, Twitter said in a statement that the rights of free speech afforded to the users under the First Amendment of the US Constitution include a right to disseminate anonymous or pseudonymous political speech.

The Department of Homeland Security also refused to comment on the lawsuit filed by Twitter pending litigation. The Justice Department has no immediate comment as well.

This is not the first time Twitter sued a government agency. In 2014, it filed a lawsuit against the US Department of Justice which sought permission to publicly disclose more information about its users. The case was partly dismissed last year according to a report by Reuters.