A vehicle-ramming attack in New York City has drawn a strong reaction from US President Donald Trump, who called the attacker "very sick and deranged" on Twitter and pledged to step up vetting of those entering the US.

At least eight people died and 11 people were injured late on Tuesday after a man drove a rented pick-up truck into cyclists and pedestrians in New York City, before being shot and wounded by police officers.

The city's mayor, Bill de Blasio, condemned the attack as "cowardly" and investigators have labelled it a "terrorist" incident.

{articleGUID}

Local news stations, citing sources in law enforcement, said the attacker, who they named as Sayfullo Saipov, had left a note inside the car in which he pledged allegiance to the Islamic State of Iraq and the Levant group (ISIL).

"We must not allow ISIS to return, or enter, our country after defeating them in the Middle East and elsewhere. Enough!" The US president tweeted, later adding: "I have just ordered Homeland Security to step up our already Extreme Vetting Program. Being politically correct is fine, but not for this!"

In NYC, looks like another attack by a very sick and deranged person. Law enforcement is following this closely. NOT IN THE U.S.A.! — Donald J. Trump (@realDonaldTrump) October 31, 2017

Trump's reaction is in keeping with his responses to other attacks when the perpetrators are associated with ISIL.

After a non-fatal tube bombing attack in London in September, Trump angrily condemned the suspect as "sick and demented".

The US leader was similarly indignant after June's deadly stabbing attack in the British capital, voicing anger at London Mayor Sadiq Khan's response to the killings.

At least 7 dead and 48 wounded in terror attack and Mayor of London says there is "no reason to be alarmed!" — Donald J. Trump (@realDonaldTrump) June 4, 2017

{articleGUID}

Similar reactions followed attacks in the Spanish city of Barcelona, and in the French capital, Paris.

In all of the cases, the attackers had expressed sympathy for ISIL or were believed to have been associated with the armed group.

The usual components found in Trump's responses to the attacks include: strong condemnation of whoever is responsible, an expression of sympathy for those affected, and a call to action in some form.

After the shooting attack on police officers on the Champs Elysee in Paris in April, the US president wrote: "The people of France will not take much more of this."

Another terrorist attack in Paris. The people of France will not take much more of this. Will have a big effect on presidential election! — Donald J. Trump (@realDonaldTrump) April 21, 2017

An earlier attack on the Louvre Museum in Paris, drew the response: "GET SMART US"

Far-right violence

Trump's reactions to attacks perpetrated by the far right, however, take on a starkly different tone, and sometimes do not elicit a reaction at all.

When white supremacist James Alex Fields Jr drove his car into a crowd of anti-racist protesters, killing one and wounding 19 others, Trump wrote: "Condolences to the family of the young woman killed today, and best regards to all of those injured, in Charlottesville, Virginia. So sad!"

Condolences to the family of the young woman killed today, and best regards to all of those injured, in Charlottesville, Virginia. So sad! — Donald J. Trump (@realDonaldTrump) August 12, 2017

Any condemnation of the attacker or his ideology was absent, and there was no call by the US president to address the issue of rising white supremacism in the US.

{articleGUID}

In a press conference shortly after the attack, Trump condemned violence on "both sides".

While the Charlottesville attack, which was widely labelled a "terrorist attack" by US media outlets, drew a response from Trump, other attacks have not made it to his Twitter feed.

Just nine days after Trump assumed the presidency, a gunman shot and killed six worshippers at a mosque in the Canadian city of Quebec.

Alexandre Bissonnette, the suspected attacker, had expressed his support for Trump's Muslim ban and white supremacist ideology.

The White House later issued a statement offering condolences to Canadian Prime Minister Justin Trudeau but Trump's reaction on his Twitter feed was muted, not mentioning the attack at all.

There was a similar response in June when a man drove a van into worshippers leaving a mosque in London, leaving one person dead.

The White House issued a statement, but Trump's Twitter feed was silent.

Trump was also criticised online for his silence when a white supremacist stabbed two men to death in the US city of Portland after they defended two Muslim teenagers he was abusing.

{articleGUID}

After heavy criticism from his opponents, the US president eventually tweeted a response, which did not include any mention of the attacker's ideology or the issue of rising white supremacism in the US.

Trump tweet: "The violent attacks in Portland on Friday are unacceptable. the victims were standing up to hate and intolerance. Our prayers are with them."

The tweet was from the official POTUS account, not Trump's personal account, however.

Online reaction

Trump's critics have seized on his reactions to different attacks as evidence of his alleged propensity for far-right ideas.

Under his most recent tweet on the attack in New York, opponents of the US leader accused him of reacting more strongly to attacks committed by Muslims than those by white supremacists.

"And where was your extreme gun vetting program after Las Vegas? Oh but wait, we're not supposed to talk politics after events like this," asked one Twitter user named Scott Rodgers, referring to the recent mass shooting in the city, in which 58 people were killed and hundreds others were injured.

What's the difference? Oh yeah, this guy's a Muslim. That's literally it. — Pé Resists (@4everNeverTrump) November 1, 2017

"What's the difference?" Asked another, before continuing "Oh yeah, this guy's a Muslim. That's literally it."