Prolific tweeter Malcom Harris was close enough to the front of the crowd that surged onto the Brooklyn Bridge during Occupy Wall Street's march on Oct. 1, 2011, that he was one of the more than 700 people whom the police encircled, arrested, and charged with disorderly conduct.

Reports about what happened that day are conflicting: Some say organizers deliberately led protesters onto the roadway to block traffic, while others say police officers led marchers to believe they could walk the vehicular route. The Manhattan District Attorney’s office claims that Mr. Harris’s Twitter messages from that day – now deleted from an account he no longer operates – will reveal the truth, so he has issued a subpoena to force the social media giant to show prosecutors what Mr. Harris had written.

On Monday, a state judge in New York ruled that Twitter must comply with the D.A.’s subpoena. Moreover, Harris's tweets over a longer period of time must also be turned over as part of New York’s investigation into any criminal activity that took place in the march across the Brooklyn Bridge, he decided.

The decision is part of a broader trend of judicial decisions allowing prosecutors greater access to people's communications on social media websites, such as Twitter, Facebook, or Instagram. Authorities say they need to view the posts to search for criminal conduct and to ascertain the authenticity of the messages. The social media companies argue that the posts belong to the individuals, under their terms of service. If that were the case, defense lawyers say, the individuals should be allowed to quash such a subpoena as a violation of the Fourth Amendment, which guarantees a reasonable expectation of privacy or would, at least, require authorities to obtain a search warrant.

“This case is indicative of a proactive attitude by the prosecutor in obtaining and using public social media statements by defendants,” says James Keneally, a partner in the white-collar practice at Kelley Drye & Warren LLP, a law firm in New York. “That is why this was of importance to the District Attorney’s office.”

In his ruling, Judge Matthew Sciarrino Jr. compared the tweets with an individual passing by who hears someone yell out a window, “I’m sorry I hit you, please come back upstairs.” At a trial, he says, the district attorney could call the person walking across the street at the time to testify about what he or she heard.

“Clearly the answer is relevant and the witness could be compelled to testify,” wrote the judge. “Well today, the street is an online, information superhighway, and the witnesses can be the third party providers like Twitter, Instagram, Pinterest, or the next hot social media application.”

That’s not how Twitter sees it. In a statement, the company, based in San Francisco, said it is disappointed in Judge Sciarrino's decision and is considering its options. “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 statement read.

Twitter had filed a motion to quash the subpoena after the court rejected Harris’s motion to do the same, saying that Harris “had no proprietary interest in the user information on his Twitter account.” The American Civil Liberties Union filed an amicus brief supporting the position that Twitter should not release Harris’s user data. They argued that for the court to say that Harris had no right to challenge the subpoena relating to his own words on Twitter was a violation of his First and Fourth Amendment rights.

Further, the ACLU argued that the broad range of user data requested – all of Harris's account information from Sept. 15 to Dec. 31 – went beyond the dates relevant to the case and included information that was never public in the first place. This includes Direct Messages, which are private communications between individuals, and Harris’s Internet Protocol address, which would reveal whenever and wherever Harris used Twitter over those 3-1/2 months.

Lawyers not involved in the case say one reasons the district attorney is pursuing the case is the need to establish what is termed “chain of custody” on the evidence. For example, the D.A. might have been able to get Harris’s tweets from a website that stores deleted messages.

“From a prosecutor's point of view, you want evidence that is authentic and real,” says Sara Shanahan, a partner in the litigation department of Sherin & Lodge LLP, a Boston law firm. “It’s better to do it with a valid subpoena versus someone running an undelete program.”

Prosecutors also may have been trying to set legal precedent for future cases, says Mr. Keneally. “They are saying, 'in cases where we believe social media information is relevant, we will use our subpoena power.' ”

The tweets from the account Harris allegedly was using Oct. 1 have long been wiped from the Web. However, two days afterward the protest march, he wrote about it for an online magazine where he is a senior editor. He tells the story then as if he were both an observer and a participant: “There’s been a lot of questions as to what exactly happened at this point; whether the police read warnings or not, whether the police enticed protesters onto the bridge with candy or not, etc. Here’s what I saw from the front lines,” he wrote.

“One of the more senior officers tries to read a warning over his megaphone, telling us to walk on the pedestrian bridge to avoid arrest, but he’s drowned out by chants of 'Take the bridge!' ” Harris continues: “The march marshals who told the police the route in advance give up trying to wave people back onto the approved path."

Harris was then arrested, along with about 700 others. Most of the cases have already been dismissed.

The disorderly conduct charge that Harris faces is a violation under New York law, which is considered an offense but not a crime and carries a maximum penalty of 15 days in jail.

In response to the news from Monday, Harris says in an e-mail that “My legal team is looking at my options. I'm not an attorney or a judge, but I've read about an extensive appeals system.”