Twitter is suing the US Government over claims that it demanded information on Twitter accounts that oppose President Donald Trump.

“The rights of free speech afforded Twitter's users and Twitter itself under the First Amendment of the US Constitution include a right to disseminate such anonymous or pseudonymous political speech,” Twitter said in the lawsuit.

The lawsuit relates to the account @ALT_uscis, which claims it is run by federal immigration employees whose official channels have been silence.

Since President Trump's inauguration in January, a number of Twitter accounts have emerged claiming they are ‘alt’ versions of US government agencies, which challenge the President's views on climate change and other issues.

The American Civil Liberties Union is reportedly representing the anonymous Twitter account - which has 33,000 followers - and will be filing on the user's behalf.

Twitter says it received an administrative summons from the US Government last month demanding records relating to the account for an investigation of duties, taxes and fines and other custom and immigration matters.

Lawyer Paul Alan Levy, a specialist in online privacy and free speech issues, says that because it is not clear how the anonymous account fits into standing laws and regulations, Twitter might have a strong case that the summons was improper.

“I don't think there is any way for the Government to come out of this looking good,” Mr Levy said.