WASHINGTON — When President Trump said this week that American Jews who chose to vote for Democrats were being disloyal, he was flirting with a notion that has fueled anti-Semitism for generations and has been at the root of some of the most brutal violence inflicted upon Jews in their history.

The accusation that Jews have a “dual loyalty” — that they are not to be trusted because their true allegiance is to their religion, rather than to the country in which they live — dates back thousands of years. It animated the Nazis in 1930s Germany, when they accused Jewish people of being traitors and used charges of disloyalty to justify their arrests, persecutions and mass killings.

After the founding of Israel, the charge was that Jews were more loyal to Israel, the Jewish state, than to their own countries. The smear persists in various forms to this day: It is a common refrain of white supremacists who claim there is a secret plot orchestrated by Jews to replace white people through mass migration and racial integration.

“The Jews have been a persistent minority for thousands of years, living in exile, living in diasporas, and the Jews have been made convenient scapegoats for various purposes,’’ said Jonathan Greenblatt, the chief executive of the Anti-Defamation League. “That’s why they often call anti-Semitism the oldest hatred.”