Manhattan criminal court Judge Matthew Sciarrino ruled that law enforcement had the right to see tweets and other user data from Malcolm Harris, who is being prosecuted for disorderly conduct in connection with the Occupy Wall Street protest on the Brooklyn Bridge last year.
The judge said that the tweets are not private information and thus not subject to the constitutional guarantee of privacy.
"If you post a tweet, just like if you scream it out the window, there is no reasonable expectation of privacy," he said in an 11-page ruling.
"The constitution gives you the right to post, but as numerous people have learned, there are still consequences for your public posts. What you give to the public belongs to the public. What you keep to yourself belongs only to you."
The ruling reaffirmed the judge's refusal of a motion by Twitter to quash the subpoena. He did grant Twitter's request to protect anything tweeted before December 31, or more than 180 days old, without a search warrant.
Chief Assistant District Attorney Daniel Alonso said after the ruling: "We are pleased that the court has ruled for a second time that the tweets at issue must be turned over. We look forward to Twitter's complying and to moving forward with the trial."
Twitter said it was studying its next move.
"We are disappointed in the judge's decision and are considering our options," a statement from the San Francisco firm said.
"Twitter's terms of service have long made it absolutely clear that its users 'own' their content. We continue to have a steadfast commitment to our users and their rights."
The American Civil Liberties Union and others have cited the case as a test of free speech online. The ACLU said it hopes the decision is eventually overturned.
"The information being requested in this particular subpoena would provide the government with a wealth of knowledge about the user's communications and geographic locations for a three-and-a-half month period," ACLU attorney Aden Fine said.
"The request covers all of the user's tweets (no longer available on Twitter), as well as his subscriber information, which includes his personal email address, the IP addresses he used," Fine said,
"The government shouldn't be able to get this sensitive and constitutionally protected information without a warrant and without first satisfying First Amendment scrutiny."
For the latest tech news and reviews, follow Gadgets 360 on X, Facebook, WhatsApp, Threads and Google News. For the latest videos on gadgets and tech, subscribe to our YouTube channel. If you want to know everything about top influencers, follow our in-house Who'sThat360 on Instagram and YouTube.