British officials have warned that Iranian and Russian hackers are targeting U.K. politicians and journalists by attempting to steal information from them.

The U.K.'s National Cyber Security Center (NCSC) issued the alert, saying that hackers usually target groups and individuals doing research and work about Iran and Russia.

Paul Chichester, NCSC's director of operations, called the espionage attacks "ruthless."

"These campaigns by threat actors based in Russia and Iran continue to ruthlessly pursue their targets in an attempt to steal online credentials and compromise potentially sensitive systems," Chichester said as quoted by BBC News.

"We strongly encourage organizations and individuals to remain vigilant to potential approaches and follow the mitigation advice in the advisory to protect themselves online."

The British cybersecurity agency said a Russian hacking group, known as SEABORGIUM or Cold River, was among those behind the recent cyberattacks.

The group of Russian hackers previously leaked emails of former MI6 head Sir Richard Dearlove and targeted U.S. nuclear laboratories.

It also targeted U.S. think tanks, a Ukraine-based defense contractor and the militaries of several countries in Eastern Europe, according to Google.

The other hacking group, TA453 or Charming Kitten, had ties with Iran's Islamic Revolutionary Guard Corps, according to independent cybersecurity experts.

The Iranian hacking group has been accused of targeting U.S. politicians and critical infrastructure.

According to the British agency, foreign hackers impersonate real contacts to establish trust and send fake invites to events or Zoom meetings with malicious code embedded in them.

If clicked on by their targets, it could compromise their accounts, allowing hackers to access sensitive information.

The NCSC said there are only tens of U.K. individuals targeted by espionage attacks which had minimal impact. But they still warned organizations to secure their online accounts and report suspicious movements.

The U.K.'s sounding of alarm against foreign hackers came after Russian President Vladimir Putin reportedly ordered his army of hackers to target critical British infrastructure.

British newspaper The Express reported that defense sources have warned that the U.K. might face cyberattacks similar to the Russian attacks on Ukraine's infrastructure.

Ukraine's top cybersecurity official Viktor Zhora said Kremlin had used hackers to access critical infrastructure in their country.

Zhora urged the U.K. to be aware of "potential evolving threats from Russia."

Last year, U.K. Foreign Secretary James Cleverly said the government has tapped cybersecurity experts to counter Russian cyberattacks since the war in Ukraine began.