A UK power generator was forced to shut down for four days after it was targeted in an Iranian cyber attack, it has been reported.

The incident, which is reported to have taken place last month, is believed to be the first time Iranian-affiliated hackers have successfully shut down a UK facility of this kind.

Sources did not name the facility, but it is understood to be a “small-scale energy generator” and the incident did not pose any risk to the wider grid, The Telegraph reports.

It is thought to have been reported to the National Cyber Security Centre (NCSC), which is part of GCHQ, and responds to serious cyber incidents impacting UK organisations.

In response, the government issued briefings to power companies and wrote to businesses with advice.

Earlier this year, Dr Richard Horne, head of the NCSC, warned that most nationally significant cyber attacks on Britain were carried out by hostile states, including China, Iran and Russia.

He said the body dealt with around four of these attacks each week, and warned businesses to be prepared to protect themselves against cyber attacks without needing the option of paying ransoms, because the UK could be targeted “at scale” if it were to become involved in an international conflict.

Cyber attacks have previously had wide-ranging and serious impacts on UK companies including Jaguar Land Rover and Co-op. GCHQ has since developed plans for a new national AI cyber shield, thought to be the first of its kind in the world.

The system, which is hoped to be running within five years, will use AI agents to detect and flag threats to critical national infrastructure, airlines, telecoms firms and other major companies in a bid to prevent future attacks.

A government spokesperson said: “The UK has a highly resilient energy system. We work closely with the energy sector to protect infrastructure and ensure the highest security standards.

“This story refers to an incident impacting a small-scale energy generator, and at no point was there a risk to the wider energy system.”

The NCSC has been contacted for comment.