In a rare rebuke to the United States, British Prime Minister Theresa May's office on Wednesday condemned President Donald Trump's decision to retweet three anti-Muslim videos from a leader of an anti-immigrant political group in the U.K.

The far-right fringe group Britain First is an ultra-nationalist party that opposes what it calls the "Islamization" of Britain. May's spokesman accused Britain First of using "hateful narratives" to spread lies.

"Britain First seeks to divide communities in their use of hateful narratives which peddle lies and stoke tensions," a spokesman for May said in a statement. "This causes anxiety to law abiding people. British people overwhelming reject the prejudice rhetoric of the far-right, which is the antithesis of the values that this country represents; decency, tolerance and respect. It is wrong for the president to have done this."

Trump hit back at May, writing on Twitter that the prime minister should "focus on the destructive Radical Islamic Terrorism that is taking place within the United Kingdom."

Donald Trump tweet: .@Theresa_May, 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 graphic videos that Trump retweeted purported to show Muslims committing crimes, but it was unclear where they had originated, or whether the people in them were in fact Muslims or migrants, as Britain First's deputy leader, Jayda Fransen, implied. Fransen thanked the president for spreading the group's message.

Fransen Tweet

The White House later claimed that it doesn't matter whether the videos were real or not, because "the threat is real."

—CNBC's Everett Rosenfeld contributed to this report.