New York - Indian Prime Minister Narendra Modi will not have to face a US lawsuit claiming he failed to stop anti-Muslim rioting in 2002, a federal judge ruled on Wednesday.

U.S. District Judge Analisa Torres in New York upheld the US Department of State’s determination that Modi is entitled to immunity as a sitting head of government from civil lawsuits filed in US courts. The lawsuit, filed in September by an obscure human rights group on the eve of Modi’s maiden visit to the United States, made international headlines at the time, though officials from both countries brushed it off as a distraction.

Joseph Whittington, the president of the human rights group American Justice Center and a city council member in Harvey, Illinois, acknowledged in September that the case had little chance of succeeding but said there was victory in ‘symbolism.’ The center was represented by a little-known attorney in New York, Babak Pourtavoosi, who specialized in immigration law.

Pourtavoosi did not immediately respond to a request for comment. The judge’s decision comes just ahead of a planned visit by President Barack Obama to attend India’s Jan. 26 Republic Day celebrations at Modi’s invitation. The lawsuit claimed Modi, a Hindu nationalist, did nothing to halt riots in his home state of Gujarat in which more than 1,000 people died in reprisals after a train carrying Hindu pilgrims was set on fire. Modi was denied a U.S. visa in 2005 under a law that bars entry to foreigners who have committed ‘particularly severe violations of religious freedom,’ but Obama was quick to invite him to the United States after Modi’s election.