Theresa May has launched her strongest attack on Russia yet, accusing Moscow of meddling in elections and carrying out cyber espionage.
Addressing leading business figures at a banquet in London, the prime minister said Vladimir Putin's government was trying to "undermine free societies".
Mrs May said it was "planting fake stories" to "sow discord in the West".
But, she added, whilst the UK did not want "perpetual confrontation" with Russia, it would protect its interests.
Her comments are in stark contrast to those of US President Donald Trump, who last week said he believed President Putin's denial of intervening in the 2016 presidential election.
Foreign Secretary Boris Johnson is due to visit Russia next month.
In a major foreign policy speech at the Lord Mayor's Banquet at Mansion House, which Mrs May described as a "very simple message" for President Putin, she said he must choose a very "different path" from the one that in recent years had seen Moscow annex Crimea, foment conflict in Ukraine and launch cyber attacks on governments and Parliaments across Europe.
Russia could be a valuable partner of the West but only if it "plays by the rules", she argued.
"Russia has repeatedly violated the national airspace of several European countries and mounted a sustained campaign of cyber espionage and disruption.
"This has included meddling in elections and hacking the Danish Ministry of Defence and the Bundestag among many others."
"We know what you are doing and you will not succeed. Because you underestimate the resilience of our democracies, the enduring attraction of free and open societies and the commitment of Western nations to the alliances that bind us."
She said as the UK left the EU and charted a new course in the world, it remained absolutely committed to Nato and securing a Brexit deal which "strengthens our liberal values", adding that a strong economic partnership between the UK and EU would be a bulwark against Russian agitation in Europe.
Mr Johnson, who will be making his first trip to Russia since becoming foreign secretary in December, has said the UK's policy to Russia must be one of "beware but engage" following a decade of strained relations.
He told MPs earlier this month that he had not seen any evidence of Russia trying to interfere in British elections or the 2016 Brexit vote, in which Moscow has insisted it remained neutral.
"We will take the necessary action to counter Russian activity," Mrs May added.
"But this is not where we want to be and not the relationship with Russia we want.
"We do not want to return to the Cold War or to be in a state of perpetual confrontation.
"As a permanent member of the UN Security Council, Russia has the reach and the responsibility to play a vital role in promoting international stability.
"Russia can, and I hope one day will, choose this different path. But for as long as Russia does not, we will act together to protect our interests and the international order on which they depend."
BBC diplomatic correspondent James Landale said the UK's stance towards Russia was hardening.
He said Mr Johnson could be assured of a cool reception when he visits Russia following Mrs May's speech.
Responding to Mrs May's speech, former Labour cabinet minister Ben Bradshaw – who has been raising the issue of Russian interference in UK elections for nearly a year – tweeted: "Asking why May suddenly acknowledging Russian interference now having stonewalled for months."
In her speech, she also said the authorities in Myanmar – formerly known as Burma – must take "full responsibility" for what "looked like ethnic cleansing" of the Rohingya people in Rakhine province.