NEW YORK — A federal judge in New York has tossed out a lawsuit accusing India's prime minister of failing to do enough to stop religious riots.

Judge Analisa Torres in Manhattan rejected the lawsuit against Narendra Modi on Wednesday. She says Modi is entitled to immunity as the sitting head of a foreign government.

The lawsuit was filed last year as Modi made his first trip to the United States as head of government.

It claims he failed to stop riots in his home state of Gujarat in 2002 when he served as chief minister there. More than 1,000 people, most of them Muslims, were killed.

A human rights group, the American Justice Center, filed the lawsuit seeking unspecified damages. A lawyer did not immediately respond to a message seeking comment.