Anti-Semitic hashtag #unbonjuif went viral on Twitter (Screengrab)

Twitter has agreed to cancel anti-Semitic messages posted under the hashtag #unbonjuif, which means a good Jew in French, after a Jewish student union threatened legal action against the micro-blogging site.

Offensive comments have flooded Twitter with a sort of competition of anti-Semitic jokes that made the hashtag to become the third most popular among French Twitter users.

A day after Twitter applied its local censorship policy for the first time by blocking access to a neo-Nazi account to users in Germany, a lawyer for the Jewish UEJF union told AFP that the US company has agreed to apply French law and remove offensive messages.

With the messages posted on the far-right Besseres Hannover account, Twitter enacted its new policy on censorship, whereby accounts can be blocked in individual countries if the content violates local law. The policy was announced in January, and has never previously been enacted.

Public expression of neo-Nazi sentiment has been illegal in Germany since the 1950s. Police can even arrest someone making the Nazi salute in public.

In the past week, two major anti-racist organisations in France, MRAP and SOS Racisme, said they were outraged and threatened to sue Twitter users sending anti-Semitic tweets.

MRAP demanded that Twitter should "take the appropriate measures" to end what it called a flood of anti-Semitism.

Offensive tweets under the hashtag included "A good Jew can pump up your tyre with his nose" and "A good Jew is a dead Jew".

Announcing the lawsuit, the UEJF's lawyer Stephane Litti had said: "There is a fire that we have to put out. We want to put an end to this outpouring of hatred".