Hackers attacked and took down Iran's oil ministry website and affiliated sites, local media reported.
The websites, including the National Iranian Oil Company, were targeted from Sunday.
An oil ministry spokesman, Alireza Nikzad, told Fars news agency that the attack was a virus that "attempted to delete data on oil ministry servers".
He added that the computer worm damaged some general information but failed to harm the main data of the ministry.
"This cyber attack has not damaged the main data of the oil ministry and the National Iranian Oil Company (NIOC) since the general servers are separate from the main servers, even their cables are not linked to each other and are not linked to internet service," Nikzad said.
"We have a backup from all our main or secondary data, and there is no problem in this regard," he added.
Iran announced in February that it was poised to build its first cyber army to prevent computer worms breaking into and stealing data from Iran's networks, including nuclear facilities, po2wer plants, data centre and banks.
"Countries like Iran also have to set up and upgrade their cyber defence headquarters and even build a cyber-army," Brig Gen Gholamreza Jalali, commander of the Civil Defence Organisation, said.
Last year, Tehran authorities discovered a sophisticated Trojan called Duqu, a computer worm which surreptitiously enters a system and leaks information.
Many international experts believe the virus was developed by the United States, possibly with Israeli collaboration, to disrupt Iran's disputed nuclear programme.
In November, Iranian officials announced the development of a software program that can control the spyware.
Duqu is the successor of Stuxnet, a virus identified in June 2010 and designed to infect computers using supervisory control and data acquisition systems.
The latest development came after reports that Iranian hackers attempted a cyber attack on Bank Hapoalim, the largest bank in Israel.