The incident is understood to have been reported to the National Cyber Security Centre (NCSC), a public-facing branch of the GCHQ spy agency that issues advice to companies on keeping national infrastructure safe from foreign threats.

British and American intelligence agencies have repeatedly warned of the risk posed by hackers from Russia, China, Iran and North Korea, which bombard critical national infrastructure and government agencies with attacks on a daily basis.

Major incidents have previously brought down NHS systems, schools and commercial manufacturing facilities, including production lines at Jaguar Land Rover.

Foreign hacking groups have also stolen customer information from retail businesses, including attacks last year, and voter records from the Electoral Commission.

However, no hacker is thought to have ever succeeded in bringing a British power plant to a standstill, despite warnings that attacks on national infrastructure are commonplace.

It is unlikely that the attack against the UK power plant was intended to inflict genuine harm on civilians, and is not thought to have been widely noticed by the public.

But it is possible that the incident was designed to prove that hackers linked to Iran’s Islamic Revolutionary Guard Corps could gain access to systems in the UK and close down sensitive infrastructure sites.

‘Malicious cyber actors’

There are dozens of small-scale power plants across Britain connected to the grid. Many of them are gas-fired and only used for a few hours per week, for example when wind speeds are low and extra energy is needed.

A four-day outage at such a facility would not impact the wider grid. Some factories and other facilities such as hospitals also have their own separate power generators.

The US hacks affected dozens of wastewater treatment plants, causing flooding and a loss of pressure from taps, and forcing some authorities to advise customers to boil their water before drinking it.

The first reports of an incident emerged in Minnesota on July 26, followed by a series of similar security breaches in Michigan, Georgia, South Dakota and New Jersey.

The FBI attributed the incidents to “malicious cyber actors”, but US government sources later confirmed to media outlets that the threat was likely to have originated in Tehran.

Iran has dramatically stepped up its cyber attacks on Western countries in the wake of the conflict in the Middle East, and especially since the US and Israel began air strikes in February.