Twitter has relented in its fight with New York prosecutors to hand over three months worth of messages from an Occupy Wall Street protester ahead of the activist's criminal trial.

Twitter had argued that the posts belong to Malcolm Harris and as such it would be violating fourth amendment privacy rights if it were to disclose the communications.

But having lost a legal appeal against a subpoena, Twitter faced the prospect of steep fines if it did not comply with the judges order to turn over the tweets to the Manhattan district attorney's office.

The firm handed over the tweets on Friday after being told by a New York judge that it would be held in contempt after that date.

The activist has been charged with disorderly conduct in relation to a protest on the Brooklyn Bridge in October last year. He was among several hundred Occupy Wall Street demonstrators arrested during the protest march.

Prosecutors say that messages posted by Harris – who goes by the twitter handle @destructuremal – could show whether the defendant was aware that he was breaking police orders relating to the demo.

In January, the New York district attorney's office issued a subpoena to Twitter, calling on the firm to hand over "any and all user information, including email address, as well as any and all tweets posted for the period 9/15/2011 – 12/31/2011".

Harris initially attempted to block the move, but was told that he had no proprietary interest to his own messages.

Twitter countered that this contradicts its own terms and conditions, which explicitly states that users "retain their right to any content they submit, post or display on or through". Moreover, in its own legal challenge to the subpoena, the firm accused prosecutors of trying to force its employees to violate federal law.

Lawyers for Twitter also argued that under the Uniform Act, prosecutors would need to obtain a subpoena in California before it could demand documents from a company based in that state.

But a New York judge rejected most of the firm's arguments and ordered Twitter to hand over the messages to the court, which would review the material and hand over relevant tweets to prosecutors

No one at the firm was available to comment, and the New York's district attorney's office declined to respond.

Harris' lawyer, Martin Stolar, said the decision by Twitter to hand his client's messages "certainly doesn't help out case".

He added: "I assume Twitter made a business decision, that they did not want to go into contempt. I would think they would be better off making a business decision to stick up for the fundamental privacy rights of their customers."

Harris has pleaded not guilty. Mr Stolar said Friday that he would continue to appeal against the tweets being used as evidence in any criminal trial.

© Guardian News and Media 2012