Iran says it is on high alert for online assaults, which it has blamed in the past on its arch-foes United States and Israel. The United States and other Western powers meanwhile have accused Iran of trying to disrupt and break into their networks.
"The disruption at the refuelling system of gas stations ... in the past few hours, was caused by a cyberattack," state broadcaster IRIB said. "Technical experts are fixing the problem and soon the refuelling process...will return to normal."
The oil ministry said only sales with smart cards used for cheaper rationed gasoline were disrupted and clients could still buy fuel at higher rates, the ministry's news agency SHANA reported.
"This attack was probably carried out by a foreign country. It is too early to announce by which country and in which way it was done," Abolhassan Firouzabadi, secretary of Iran's Supreme Council of Cyberspace, told state TV.
The disruptions came ahead of the second anniversary of an increase in fuel prices in November 2019 which led to widespread street protests in which hundreds were reported to have been killed by security forces.
Videos posted on social media showed apparently-hacked digital street signs carrying messages such as "Khamenei, where is our gasoline?", in a reference to Supreme Leader Ayatollah Ali Khamenei.
Reuters could not independently authenticate the videos but Iran's semi-official Mehr news agency confirmed that some signs had been hacked.
Industry officials told state TV that nearly half of gas stations had reopened as technicians rushed to activate manual settings after online functions were paralysed by hackers. Officials gave assurances there were no fuel shortages and that the remaining stations would reopen by mid-day on Wednesday.
In the past, Iran has been targeted by a series of cyberattacks such as one in July when the website of the transport ministry was taken down by what state media said was a "cyber disruption".
Also in July, train services nL2N2OL1JF were delayed by apparent cyberattacks, with hackers posting the phone number of Supreme Leader Khamenei's office as the number to call for information.
The computer virus Stuxnet, which is widely believed to have been developed by the United States and Israel, was discovered in 2010 after it was used to attack a uranium enrichment facility in Iran. It was the first publicly known example of a virus being used to attack industrial machinery.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)