The social networking site had been threatened with steep fines if it did not comply with Judge Matthew Sciarrino Jr.'s order to turn over the records in the case of Malcolm Harris.
But the judge said he would keep the records sealed until after a Sept. 21 hearing challenging his ruling on the messages.
Twitter's lawyer, Terryl Brown, called the options it faced — waiving its right to appeal or being in held in contempt of court — "unfair" and "unjust," though ultimately Brown handed over a thick white envelope full of Harris' information.
"We are disappointed that Twitter is essentially giving up the fight," Harris' attorney Martin Stolar said after the court hearing.
The Manhattan district attorney's office said Harris' messages could show whether he was aware of the police orders he's charged with disregarding during a protest at the Brooklyn Bridge.
The case began as one of hundreds of disorderly conduct prosecutions after an Oct. 1 march in New York that brought the Occupy protest movement its first burst of worldwide attention. Harris was among more than 700 people arrested when protesters tried to cross the bridge, many on the roadway.
Police said demonstrators ignored warnings to stay on a pedestrian path. Harris, an editor for an online culture magazine, and others say they thought they had police permission to go on the roadway.
Prosecutors want tweets and user information from Sept. 15 to Dec. 31 that were taken down from the public site. After a certain period of time, tweets are automatically flushed out by the system and placed in the site's stored electronic records, Stolar said.
Internet privacy and civil liberties groups have said the case is important because individuals must be able to fight for their constitutional rights, but they also wanted to see how the large and influential company handled the request.
"I think the biggest implication is going to be about how companies are going to react to what happened to Twitter here," said Hanni Fakhoury, a staff attorney with the Electronic Frontier foundation. "One of the things we were happy to see is that Twitter actually took a stand and tried to challenge this — most companies wouldn't go that far."
Still, it's a hard argument to make — because Twitter by nature is so public, said Joel Reidenberg, a Fordham Law Professor and expert on internet privacy issues.
"The tweets themselves are public information, it's like speaking on a street corner," he said. "His claim to privacy on the tweets is pretty weak, frankly."
Harris, 23, said Friday that he did not delete any incriminating tweets. He told reporters he wasn't sure what the tweets might contain. "Three and a half months, a lot of nonsense," he said.
Asked whether the case had affected what he posted to Twitter, Harris said: "I guess you'd have to check the feed to find out. It's still public."
Earlier this year, Harris sought to block prosecutors from subpoenaing the information from Twitter Inc. The company stepped in after the judge ordered the messages to be turned over.
Harris had argued that seeking the accompanying user information violated his privacy and free association rights. The data could give prosecutors a picture of his followers, their interactions and his location at various points during the protest, Stolar said.
Twitter had said the case could put it in the unwanted position of having to take on legal fights that users could otherwise conduct on their own. Company lawyers argued that Harris had every right to fight the subpoena.
Its agreements say users own content they post and can challenge demands for their records. The company argued in a court filing that it would be "a new and overwhelming burden" for Twitter to have to champion such causes for them.
Sciarrino said he would review all the material he ordered turned over and would provide "relevant portions" to prosecutors.
Harris has pleaded not guilty and his trial is scheduled for December. If convicted, he faces a maximum penalty of 15 days in jail or a $500 fine, his lawyer said.
"So Twitter handed over a pile of my tweets that'll stay sealed pending a hearing on the 21st." Harris tweeted after the hearing. "Bummer."