Twitter has handed French authorities data which could identify the users behind a spate of antisemitic tweets after a long court battle begun by anti-racism campaigners.

In a rare move, the microblogging site announced on Friday that "in response to a valid legal request" it had provided the Paris prosecutor with "data that may enable the identification of certain users that the vice-prosecutor believes have violated French law". Twitter said this gesture put an end to the long legal dispute.

In October last year, there was outrage after numerous antisemitic comments were tweeted under the hashtags #UnBonJuif (a good Jew) and #UnJuifMort (a dead Jew). When alerted to the tweets, Twitter immediately removed them.

The French Union of Jewish Students (UEJF), backed by anti-racism groups, appealed to a judge to force Twitter to hand over personal details of users who had posted the tweets so they could be prosecuted under French laws against publishing racist and discriminatory hate speech.

Twitter contested the case but in January the Paris high court ruled against the site, saying it must hand over user data. The judge said the messages violated French laws against hate speech and Holocaust denial.

Last month, the Paris appeals court decided not to hear Twitter's appeal and reiterated that it must hand over the user details.

In March the UEJF had launched a civil suit against Twitter for failing to hand over the details, claiming €38.5m (£33m) in damages which it said it would hand over to the Shoah Memorial Fund. It also announced it would sue Twitter's chief executive, Dick Costolo.

Twitter, in its statement on Friday, also vowed to continue to "fight against racism and antisemitism". It said this included "taking measures to improve the accessibility of the reporting procedure of illegal tweets".

Last year, Twitter was ordered to hand over almost three months' worth of messages from an Occupy Wall Street protester, Malcolm Harris, after losing a legal challenge to prosecutors' demands for the old tweets that were no longer on its public site. Twitter is backing an appeal by Harris.

In 2011, Twitter challenged a court order obtained by the US justice department requesting user details from some accounts associated with WikiLeaks.

In 2012, in an unprecedented move in Germany, Twitter complied with a request by authorities to block the account of a banned neo-Nazi group in accordance with German law.