Image copyright Getty Images Image caption General Pershing later led US forces in World War One

US President Donald Trump has invoked a debunked myth about a general who fought Islamist militants by using pig's blood to commit mass executions.

The president's tweet came hours after a driver crashed a van into a crowd of people in Barcelona, leaving many dead or injured.

"Study what General Pershing... did to terrorists when caught," Mr Trump said, referring to the discredited story.

Historians and fact checkers say there is no truth to it.

The myth, which has circulated online, refers to General John Pershing's actions during the US war in the Philippines in the early 1900s.

He is said to have rounded up 50 terrorists and then ordered his men to shoot 49 of them, using bullets dipped in pig's blood. The survivor was told to go back and tell his people what happened.

Pigs are considered ritually unclean in Islam, and in his tweet the president said the general's actions acted as a deterrent to further acts of terror.

His comments came shortly after more than a dozen people were killed on Thursday in the Las Ramblas area of Barcelona.

Police say it was clearly a terrorist attack and they have arrested two people but not yet located the driver.

On the campaign trail, Mr Trump once told the same story, but that time he said there was no Islamist insurgency for 25 years, rather than 35.

The president has been engulfed in controversy since Saturday, when he said violence at a far-right rally should be blamed on "all sides".

Heather Heyer was killed when a speeding car rammed into a crowd of anti-fascist protesters in Charlottesville.

Republicans have rounded on President Trump for his comments and a slew of resignations among chief executives on two business councils led to their disbandment.