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.” On Tuesday, Mr. Trump drew a barrage of criticism from Jewish organizations and anti-hate groups when he said, as he assailed a pair of Democratic congresswomen who are harshly critical of Israel, that Jews who vote for Democrats show “either a total lack of knowledge or great disloyalty.” On Wednesday, as he retweeted a conspiracy theorist saying that Jews in Israel loved the president “like he’s the king of Israel,” Mr. Trump used the same language,telling reporters that “if you want to vote Democrat, you are being very disloyal to Jewish people and very disloyal to Israel.” A look at the long and ugly history of the dual loyalty canard helps explain why Jewish leaders and anti-hate groups have reacted so strongly to Mr. Trump’s comments.