Twitter has withdrawn a lawsuit against the U.S. government after the Customs and Border Protection backed down on a demand that the social media outlet reveal details about a user account critical of the agency.

The lawsuit, filed Thursday, contended that the customs agency was abusing its investigative power. The customs agency has the ability to get private user data from Twitter when investigating cases in areas such as illegal imports, but this case was far from that.

The target of the request was the @alt_uscis account, one of a number of "alt" accounts that have sprung up on Twitter since the inauguration of President Donald Trump. The accounts are critical of the new administration and most claim to be run by current or former staff members of government agencies.

The customs agency's investigation into who started the @alt_uscis account led to the request that Twitter identify the author. USCIS is the U.S. Citizenship and Immigration Services and is part of the Department of Homeland Security alongside the customs service.

Twitter said it filed the lawsuit after warning the government it would do so if the request was not withdrawn. On Friday, a day after Twitter delivered on its threat and after a heap of media coverage, the government withdrew its request.

"The speed with which the government buckled shows just how blatantly unconstitutional its demand was in the first place," said Esha Bhandari, an attorney for the American Civil Liberties Union, which was representing the Twitter user in the case.

"Speaking anonymously about issues of the day is a longstanding American tradition, dating back to when the framers of the Constitution wrote under pseudonyms. The anonymity that the First Amendment guarantees is often most essential when people criticize the government, and this free speech right is as important today as ever," Bhandari said in a statement.