The EU is to impose tough sanctions on those who launch cyberattacks, be it to attack infrastructure, obtain sensitive corporate information or influence elections.
"The Council (of EU countries) established a framework which allows the EU to impose targeted restrictive measures to deter and respond to cyberattacks," the council said in a statement issued Friday.
Among the measures are asset freezes and travel bans, which can also be imposed for attempted attacks.
Under the legislation, diplomats said, the 28 EU countries would have to vote unanimously to impose sanctions if the attack is deemed to have "significant impact."
The Council said it was "concerned at the rise of malicious behavior in cyberspace that aims at undermining the EU's integrity and security and economic competitiveness, with the eventual risk of conflict."
Read more: Europe's cybersecurity gap threatens infrastructure, elections
UK: Russia 'take heed'
The UK's Foreign Office called the new measures "decisive action," adding that "the international community will take all necessary steps to uphold the rule of law and the rules-based international system which keeps our societies safe."
Foreign Secretary Jeremy Hunt went as far as addressing Russia, which has been accused by several Western nations of meddling in elections through targeted trolling operations, directly by saying "Russia please note and take heed."
Every evening at 1830 UTC, DW's editors send out a selection of the day's hard news and quality feature journalism. You can sign up to receive it directly here.