LONDON — Dispensing with diplomatic niceties, British Prime Minister Theresa May on Monday night charged Vladimir Putin’s Russia with attempting to “undermine free societies” and “sow discord” in Britain and the West by “weaponizing information” and “deploying its state-run media organizations to plant fake stories.”

“So I have a very simple message for Russia. We know what you are doing. And you will not succeed,” May said. “The U.K. will do what is necessary to protect ourselves, and work with our allies to do likewise.”

May’s condemnation, in a speech before business executives in a London banquet hall, was quite different from remarks over the weekend by President Trump, who appeared to take sides with the Russian president.

“He said he didn’t meddle,” Trump said Saturday, answering questions in the press cabin on Air Force One, about growing evidence of Russia’s involvement in the 2016 presidential campaign. “I asked him again. You can only ask so many times. . . . He said he absolutely did not meddle in our election. He did not do what they are saying he did.”

Trump said he believed Putin was “sincere” in his denials, and even felt insulted by the accusation, according to a Washington Post report.

May is confronting Russia now because of growing concern in London of widespread attempts by Russia to manipulate social media across Europe, “included meddling in elections and hacking the Danish Ministry of Defense and the [German] Bundestag, among many others,” the prime minister said.

Yin Yin Lu of the Oxford Internet Institute told the Times of London that 54 accounts on a list of 2,752 linked by Twitter to the Internet Research Agency tweeted about “Brexit,” Britain’s planned exit from the European Union. The Internet Research Agency is a Russian “troll farm” in St. Petersburg.

The Times of London also reported:

“Damian Collins, the Conservative MP who is leading a parliamentary inquiry into fake news, has requested data from Twitter and Facebook on Russian accounts that posted about the EU referendum. The small number of accounts positively identified as Russian could be the tip of the iceberg, he has said.”

May’s remarks appear to contradict those of Foreign Secretary Boris Johnson. Asked earlier this month whether he suspected that Russia had played a role in recent British elections, he answered: “No, I haven’t seen any [evidence], not a sausage. ... As far as I know they have played no role,” according to Reuters.

Johnson will head to Moscow next month for meetings, his first as foreign secretary.

BuzzFeed News asked Facebook on Monday whether there were “any Kremlin-linked ads” on the social site around the time of the 2016 Brexit vote. A spokesperson told BuzzFeed, “To date, we have not observed that the known, coordinated clusters in Russia engaged in significant coordination of ad buys or political misinformation targeting the Brexit vote.”

In BuzzFeed’s view, this meant that earlier statements from Facebook executives that there was no evidence Russia had meddled in the Brexit vote were being walked back.

In her speech, May not only confronted Russia on its alleged cyber campaigns, but its annexation of Crimea and its stoking of conflict in eastern Ukraine.

She said this is why NATO is sharpening its abilities “to better [be] able to deter and counter hostile Russian activity.  It is why we have stepped up our military and economic support to Ukraine ... and looking at how we tighten our financial regimes to ensure the profits of corruption cannot flow from Russia into the U.K.”

The prime minister added, “We do not want to return to the Cold War or to be in a state of perpetual confrontation.”

The BBC quoted Alexei Pushkov, a Russian senator who dismissed May’s charges in a series of tweets.

“The world order that suits May, with the seizure of Iraq, war in Libya, the rise of IS and terrorism in Europe, has had its day. You can’t save it by attacking Russia,” Pushkov wrote, in a BBC translation.