The story, which has circulated online for years, has been dismissed as unsupported by historical documentation or evidence by websites that fact-check Internet rumors. Mr. Trump used it to illustrate his call to push back with brutal force against both Islamic terrorism and political correctness.

“This is something you can read in the history books,” Mr. Trump told his supporters, adding, “Not a lot of history books, because they don’t like teaching it.”

According to Mr. Trump’s telling, Gen. Pershing brought an end to terrorism after he captured 50 terrorists and executed 49 of them with blood-soaked bullets. The general told the sole survivor, “ ‘You go back to your people and you tell them what happened,’ ” Mr. Trump said.

Gen. Pershing used pigs’ blood, Mr. Trump said, because Muslims have “a whole thing with swine and animals and pigs, and you know the story — they don’t like them.”

Image Suzanne Barakat comforted her father, Namee Barakat, center, during a funeral service last year. Credit... Brendan Smialowski/Agence France-Presse — Getty Images

The moral, Mr. Trump said, is, “We better start getting tough, and we better start getting vigilant and using our heads, or we’re not going to have a country, folks.”

Muslim-American groups reacted with horror to the remarks. Nihad Awad, the Executive Director of the Council on American-Islamic Relations said in a statement that Mr. Trump had “crossed the line from spreading hatred to inciting violence” in ways that placed Muslim-Americans “at risk from rogue vigilantes.”