Cyber attacks on energy companies in the Persian Gulf raise fears of further assaults that could cause panic and destruction, the US has warned.
The attacks, which have been described as a "pre-9/11 moment", used a virus called Shamoon which can spread through computer networks and overwrite files.
Saudi Arabia's state oil company, Aramco, had to replace 30,000 computers after crucial system files were replaced with an image of a burning US flag.
The Qatari natural gas producer RasGas was also targeted.
A former US official, speaking on condition of anonymity because the investigation into the attacks is classified as secret, said the country believes Iranian hackers are to blame.
The US Defence Secretary Leon Panetta publicly acknowledged the attacks for the first time, although he did not make a direct link to Iran.
He said: "These attacks mark a significant escalation of the cyber threat. They have renewed concerns about still more destructive scenarios that could unfold.
"We know of specific instances where intruders have successfully gained access to these control systems.
"We also know they are seeking to create advanced tools to attack these systems and cause panic and destruction, and even the loss of life."
The US is investing more than \$3bn a year in online security to guard against cyber attacks.
Authorities have repeatedly warned that foreign hackers are probing critical computer networks, including those that control power plants, transportation systems and financial networks.
Mr Panetta said: "Our mission is to defend the nation. We defend. We deter. If called upon, we take decisive action to protect our citizens.
"Before September 11, the warning signs were there. We weren't organized. We weren't ready and we suffered terribly for that lack of attention.
"We cannot let that happen again. This is a pre-9/11 moment."