NEW YORK (Reuters) - A federal judge on Thursday dismissed two lawsuits seeking to hold Facebook Inc FB.O liable for supporting terrorist groups by letting them use its social media platform to further their goals, including violence against Jews.

Facebook logo is seen on a wall at a start-up companies gathering at Paris' Station F in Paris, France, January 17, 2017. REUTERS/Philippe Wojazer

U.S. District Judge Nicholas Garaufis in Brooklyn dismissed a $3 billion damages lawsuit by relatives of American victims of Hamas attacks, saying the federal Communications Decency Act regulating internet content immunizes Facebook from liability.

That law “prevents courts from entertaining civil actions that seek to impose liability on defendants like Facebook for allowing third parties to post offensive or harmful content or failing to remove such content once posted,” Garaufis wrote.

Garaufis also dismissed a lawsuit by roughly 20,000 Israeli citizens who feared harm from future violence. He said they had no legal right to demand changes to Facebook’s platform because they could not show any “actual or imminent” injury.

The decision is a setback to efforts to hold companies such as Facebook and Twitter Inc TWTR.N liable for failing to better police users' online speech.

Robert Tolchin, a lawyer for both sets of the plaintiffs, said Garaufis appeared to sidestep limits under the federal Anti-Terrorism Act on aiding groups such as Hamas, a Palestinian group that the Department of State designates a foreign terrorist organization.

“There is a clash between statutes that the court needed to reconcile but ignored,” Tolchin said in an interview. “We are planning to appeal because we see major errors in the decision.”

In an email, Facebook said “there is no place on Facebook for groups that engage in terrorist activity or for content that expresses support for such activity, and we take swift action to remove this content when it’s reported to us. We sympathize with the victims and their families.”

Congress passed the Communications Decency Act of 1996 to regulate online pornography.

Garaufis said applications of that law in other contexts have arguably undermined incentives for internet service providers to remove content, but that it was enough for now to show that Congress’ “focus” was to limit liability.

The Brooklyn lawsuits drew notice after Facebook’s law firm Kirkland & Ellis initially assigned a junior associate to represent the Palo Alto, California-based company, prompting Garaufis to ask if it took the matter seriously.

Facebook quickly flew its deputy general counsel, Paul Grewal, a former federal judge, from California to Brooklyn, where he assured Garaufis that the company had “a very serious interest in keeping terrorism content off” its platform.

The cases are Cohen et al v. Facebook Inc, U.S. District Court, Eastern District of New York, No. 16-04453; and Force et al v Facebook Inc in the same court, No. 16-05158.