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

LONDON — With a few retweets, President Donald Trump has prompted outrage across the British political spectrum and severely tested relations with one of the United States' closest allies.

Many in the U.K. said Trump was explicitly endorsing extremism by sharing inflammatory anti-Muslim and anti-immigrant videos posted by a senior member of a fringe far-right group.

The mood here was further soured by Trump’s decision to double down and seemingly criticize Prime Minister Theresa May from his social-media pulpit.

"Don't focus on me, focus on the destructive Radical Islamic Terrorism that is taking place within the United Kingdom. We are doing just fine!" the president said on Twitter.

"This is not left versus right — everyone here is appalled by this."

The reaction from lawmakers and commentators was swift and scathing.

"The president of the United States is now an accessory to the incitement of hate and the incitement of violence," said Scott Lucas, a professor of American studies at the U.K.'s University of Birmingham. "What he has done is given them this platform on social media and then compounded it by saying the prime minister is illegitimate."

Trump had already endured staunch criticism after suggesting there was "blame on both sides" for the race-fueled riots in Charlottesville, Virginia, in August, suggesting that counterprotesters were as much at fault as the white nationalist they were demonstrating against.

But Trump’s retweet Wednesday went further than he had before, Lucas said. "This is not left versus right — everyone here is appalled by this."

London Mayor Sadiq Khan said Trump's comments undermined the long-lasting U.S.-U.K. relationship.

"Many Brits who love America and Americans will see this as a betrayal of the special relationship between our two countries," Khan said Thursday. "It beggars belief that the president of our closest ally doesn't see that his support of this extremist group actively undermines the values of tolerance and diversity that makes Britain so great."

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

Khan, London's first Muslim mayor and a member of the opposition Labour Party who tangled with Trump over the summer after the London Bridge terror attack, was not the only politician to criticize the president. Senior members of the ruling Conservative Party, which covers a broad swath of the political right, also lashed out at Trump.

"British people overwhelmingly reject the prejudiced rhetoric of the far right," Amber Rudd, the country’s home secretary, told the House of Commons.

Rudd also welcomed a suggestion by Conservative lawmaker Peter Bone that Trump delete his Twitter account, saying, "I'm sure many of us might share his view."

In a likely concession to pragmatism, Rudd added that the government would not cancel an offer to Trump of a state visit hosted by Queen Elizabeth II. The U.K. is in the midst of talks to exit the European Union and sees strong trade relations with the U.S. as key to the country’s success after Brexit.

What sparked this week's furor was Trump's sharing three videos posted by Jayda Fransen, deputy leader of the fringe group Britain First, which opposes what it calls the "Islamization" of Britain and has engaged in a series of stunts, including occupying mosques.

Jayda Fransen marching in central London. Daniel Leal-Olivas / AFP - Getty Images file

The group is the latest incarnation of a strain of ultranationalism that has existed on the political fringes in Britain for decades, and has been linked to other acts of incitement and aggression.

According to witnesses, a far-right, Nazi-obsessed nationalist who murdered British lawmaker Jo Cox in 2016 shouted "Britain First!" when he fired his gun, although the group has denied any connection with the murder.

In September, the leaders of the organization, including Fransen, were charged with causing religiously aggravated harassment by disseminating leaflets and sharing online videos. Fransen herself has been convicted of abusing a Muslim woman.

The U.K. does not have the equivalent of a First Amendment, and free speech in the country is subject to a number of laws prohibiting the stirring up of religious and racial hatred.

Labour lawmaker David Lammy suggested the president's retweets could run afoul of these restrictions.

The sharing of those videos is a crime in the UK called inciting hatred. We should be asking the FBI to investigate, putting @realDonaldTrump on a watch list and barring him from entry to our country. A state visit is a lowly act of appeasement. Have we forgotten our history? https://t.co/umMD6iUYVt — David Lammy (@DavidLammy) November 30, 2017

During a debate in Parliament on Thursday, several lawmakers warned that Trump's retweets would end up promoting a fringe group that few people have heard of. Some also called for the government to rescind its invitation to Trump.

"Britain First gets its succor from spreading its poison and its extremism online," said Yvette Cooper, of the Labour Party. "That is how it works, and the president of the United States has just given it a rocket boost in promoting hatred in our communities."

She added, "We cannot simply roll out a red carpet and give a platform for the president of the United States to sow discord in our communities."

Mike Penning, a lawmaker from the ruling Conservative Party, added: "The real danger is that the vast majority of our constituents had never heard of Britain First, and this has given them huge oxygen."

Fransen certainly appeared to be enjoying the publicity spike, addressing a video message to Trump on Thursday.

"I’d like to start by saying how delighted I am that as the leader of the free world, you took the time out to retweet three of my videos on Twitter today," she said.

Groups like Britain First have been able to exploit social media to play on anti-immigrant and anti-Muslim fears. But the far-right's reach stretches to the 1930s when fascism was on the rise throughout much of Europe.

That culminated in the legendary "Battle of Cable Street," in which London's Jews and Irish laborers stood up to the fascists who wanted to march through their streets.

While the mainstream political consensus in Britain appeared to be coalescing against Trump, other analysts warned that the views espoused by Britain First are not so universally opposed.

"Britain First are publicly reviled, but there is also a certain amount of support for the ideas advocated by them and other similar groups," said Inderjeet Parmar, a professor of international relations at City, University of London.

"This may seem like an 'easy win' to some, but there are going to be others who will agree with White House press secretary Sarah Huckabee Sanders: These videos may be fake news but the threat is real," he said.

A poll by Comres in May 2016 found that a majority of Britons did not think Islam was compatible with British values.