EDISON, N.J. — Donald J. Trump declared himself “a big fan of Hindu” and praised India’s nationalist prime minister, Narendra Modi, at an Indian-American charity event on Saturday.

Mr. Trump spoke at a benefit put on by the Republican Hindu Coalition at a convention center in Edison, N.J., a non-battleground stop that is hardly typical for a presidential nominee three weeks before an election.

Still, Mr. Trump seemed thrilled to be there.

“I am a big fan of Hindu, and I am a big fan of India,” Mr. Trump said, seeming to entangle the faith with the nation. “Big, big fan.”

While polls show that Hillary Clinton draws far more backing from Indian-Americans than Mr. Trump does, his anti-bureaucracy and country-first language closely tracks that of Mr. Modi, who has tapped into the disgust that India’s Hindu majority feels toward its government.