Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — President Donald Trump appeared to cite an apocryphal story about an American general executing dozens of Muslim prisoners in the Philippines and defiling their bodies with pig blood in the wake of a deadly terror attack in Barcelona, Spain, Thursday.

After first condemning the attack and offering the United States' support, the president said to "study what General Pershing of the United States did to terrorists when caught," an apparent reference to a debunked legend about World War I-era General John J. Pershing that Trump repeatedly recounted in his speeches on the campaign trail.

Study what General Pershing of the United States did to terrorists when caught. There was no more Radical Islamic Terror for 35 years! — Donald J. Trump (@realDonaldTrump) August 17, 2017

“He took fifty bullets, and he dipped them in pig’s blood,” Trump said at a rally in South Carolina in February 2016. “And he had his men load his rifles and he lined up the fifty people, and they shot 49 of those people. And the fiftieth person he said ‘You go back to your people and you tell them what happened.’ And for 25 years there wasn’t a problem, okay?”

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Historians have said this particular story about John J. Pershing, the World War I-era general, is not based on historical evidence and appears to have been spread by chain emails.

Trump said at the time the moral of the story was: “We better start getting tough and we better start getting vigilant, and we better start using our heads or we’re not gonna have a country, folks.”

Islam, like Judaism, forbids the consumption of pork.

Trump's tweet came hours after a car crashed into a crowd in Barcelona, Spain. Authorities there have labeled the incident a terrorist attack and taken a suspect into custody.

In addition to celebrating what would be tantamount to a war crime, Trump’s claim that such tactics ended terrorism is also inaccurate. The unrest he cited continued long afterwards and was rooted in conflict over colonial rule.

Related: Donald Trump Tells ‘Pig’s Blood’ Bullets Tale at S.C. Rally

Trump’s former campaign manager Corey Lewandowski later told the Washington Post that the story was planned ahead of time as an “analogy” and that its accuracy was incidental to its political value.

The story faded quickly at the time, since Trump first delivered the Pershing anecdote at the peak of the Republican primaries while feuding with Pope Francis, among other high-profile stories. It comes now amid a national debate over the president’s moral authority and stance on extremism after a white nationalist attack in Charlottesville, Virginia on Saturday.

A number of Republican leaders have criticized Trump in recent days for defending certain “very fine people” who marched with white supremacists and neo-Nazis and chanted “Jews will not replace us” and Hitler-era slogans the night before the car-ramming attack, which claimed the life of 32-year-old counter-protester Heather Heyer.

Republican leaders have broken with Trump in the past over previous comments that appeared to endorse war crimes, including Trump’s call to target family members of suspected terrorists and use torture to acquire information or simply because they “deserve it anyway.” Trump said he has not tried to institute torture as president on the advice of Defense Secretary Jim Mattis, who opposes its use.