Iran's president has said a cyberattack which paralysed every petrol station in the Islamic Republic was designed to get "people angry by creating disorder and disruption".

Ebrahim Raisi's remarks stopped short of assigning blame for the attack, which rendered useless the government-issued electronic cards that many Iranians use to buy subsidised fuel at the pump.

However, his remarks suggested that he and others in the theocracy believe anti-Iranian forces carried out the assault.

"There should be serious readiness in the field of cyberwar and related bodies should not allow the enemy to follow their ominous aims to make problem in trend of people's life," Mr Raisi said.

No group has claimed responsibility for the attack that began on Tuesday, though it bore similarities to another months earlier that seemed to directly challenge Iran's Supreme Leader Ayatollah Ali Khamenei as the country's economy buckles under American sanctions.

Abolhassan Firouzabadi, the secretary of the Supreme Council of Cyberspace, linked the attack to another that targeted Iran's rail system in July, in comments reported by the state-run IRNA news agency.

"There is a possibility that the attack, like a previous one on the railway system, has been conducted from abroad," Mr Firouzabadi said.

He added that an investigation into the incident was under way.

On Wednesday morning, IRNA quoted another official who claimed 80% of Iran's petrol stations had begun selling fuel again.

Associated Press journalists saw long lines at multiple petrol stations in Tehran, with 90 cars waiting for fuel at one station.

Those buying ended up having to pay at higher, unsubsidised prices.

Tuesday's attack rendered useless the government-issued electronic cards that many Iranians use to buy subsidised fuel at the pump.

The semi-official ISNA news agency, which first called the incident a cyberattack, said it saw those trying to buy fuel with a government-issued card through the machines instead receiving a message reading "cyberattack 64411''.

While ISNA did not acknowledge the number's significance, that number is associated with a hotline run through Ayatollah Khamenei's office that handles questions about Islamic law.

ISNA later removed its reports, claiming that it too had been hacked.

Such claims of hacking can come quickly when Iranian outlets publish news that angers the theocracy.

Farsi-language satellite channels abroad published videos apparently shot by drivers in Isfahan, a major Iranian city, showing electronic billboards there reading: "Khamenei! Where is our gas?"

Another said: "Free gas in Jamaran gas station," a reference to the home of the late Supreme Leader Ayatollah Ruhollah Khomeini.

The use of the number "64411" mirrored the attack in July targeting Iran's railway system that also saw the number displayed.

Israeli cybersecurity firm Check Point later attributed the train attack to a group of hackers that called themselves Indra, after the Hindu god of war.

Indra previously targeted firms in Syria, where President Bashar Assad has held on to power through Iran's intervention in his country's grinding war.

Cheap fuel is practically considered a birthright in Iran, home to the world's fourth-largest crude oil reserves, despite decades of economic woes.

Subsidies allow Iranian motorists to buy regular fuel at 15,000 rials per litre. After a monthly 60-litre quota, it costs 30,000 rials a litre.

In 2019, Iran faced days of mass protests across some 100 cities and towns over rising fuel prices.

Security forces arrested thousands and Amnesty International said it believes 304 people were killed in a government crackdown.

Tuesday's cyberattack came in the same month in the Persian calendar as the fuel protests in 2019.

The attack also came on the birthday of the late Shah Mohammad Reza Pahlavi who, stricken with cancer, fled the country in 1979 just before the Islamic Revolution.

Iran has faced a series of cyberattacks, including one that leaked video of abuses at its notorious Evin prison in August.

The country disconnected much of its government infrastructure from the internet after the Stuxnet computer virus - widely believed to be a joint US-Israeli creation - disrupted thousands of Iranian centrifuges in the country's nuclear sites in the late 2000s.