SAN FRANCISCO — Twitter dropped its lawsuit against the Trump administration after the government abruptly withdrew its request for the identity of an anonymous account critical of the president, according to court papers filed by Twitter on Friday.

The social media company had filed a lawsuit Thursday in federal court in the Northern District of California, claiming the U.S. Department of Homeland Security, U.S. Customs and Border Protection (CBP), Secretary of Homeland Security John Kelly and CBP acting commissioner Kevin McAleenan in mid-March demanded Twitter reveal the person or people behind the account @ALT_USCIS.

USCIS is the abbreviation for the U.S. Citizenship and Immigration Service, which has an official Twitter account at @USCIS. The @ALT_USCIS account, which surfaced in January on Twitter, is critical of the Trump administration.

Government workers have been setting up such Twitter accounts to release information, and criticize, government agencies since Trump was inaugurated. The suit highlighted antagonisms between the administration and those using social media to challenge it, privacy experts say.

In mid-March, CBP demanded Twitter produce usernames, account logins, phone numbers, mailing addresses and IP addresses associated with the @ALT_USCIS account, according to the suit. But the request constituted an "unlawful” use of government powers and threatened the right to free speech of Twitter users, Twitter's suit said.

Free-speech advocates agreed.

The right of people to speak anonymously is a "core" tenet of Americans' right to free speech — whether in opposition to the government or an employer, says Emma Llanso, director of free expression at the Center for Democracy & Technology, a non-profit that promotes an open and free Internet.

"If the government is trying to compel a social media company to reveal the identity of an account holder, it needs to show a strong case," Llanso says. "Disagreement with the government is not enough."

"The government must not be able to use its formidable investigatory powers to intimidate and silence its
critics," Andrew Crocker, a staff attorney for the Electronic Frontier Foundation, a non-profit digital rights group, said in a statement. "Anonymous political speech played a key role in the founding of the United States."