Demonstrators attacked a town hall in the Iranian capital on Saturday as deadly protests spilled into a third night in spite of government warnings against any further "illegal gatherings" and moves to cut off the internet on mobiles.

Videos on social media appeared to show thousands marching through the western cities of Khorramabad, Zanjan and Ahvaz. Videos filmed elsewhere show protesters setting fire to police vehicles amid reports of attacks on government buildings, the BBC reported.

Another video posted on social media showed two Iranian men in the western town of Dorud lying motionless on the ground, covered with blood, and a voiceover saying they had been shot dead by police, Reuters said.

It said security forces fired on protesters and killed at least two. Other protesters in the same video were chanting: "I will kill whoever killed my brother!"

The authorities responded to the situation by cutting internet access to mobile phones, with the main networks interrupted at least in Tehran shortly before midnight, AFP reporters said.

A swirl of wild rumours, combined with travel restrictions and a near-total media blackout from official agencies, made it difficult to confirm reports.

Several Iranian news agencies warned Telegram, the most popular social media service in the country, might soon be shut down after communications minister Mohammad-Javad Azari Jahromi accused one popular channel, Amadnews, of encouraging an "armed uprising".

Meanwhile, the conservative Mehr news agency posted videos of protesters attacking a town hall in central Tehran, overturning a police car and burning the Iranian flag.

There was chaos earlier around the capital's university as hundreds took to the streets, blocking traffic and shouting slogans against the government.

But the authorities could also count on a show of strength, with hundreds of counter-demonstrators seizing control of the university entrance, chanting "Death to the seditionists".

Counter-demonstrators

Annual rallies marking the defeat of the last major protest movement in 2009 had already been scheduled for Saturday morning and brought thousands of regime supporters into the streets across the country.

"We urge all those who receive these calls to protest not to participate in these illegal gatherings as they will create problems for themselves and other citizens," said Interior Minister Abdolrahman Rahmani Fazli.

The protests began in the second city of Mashhad on Thursday as an attack on high living costs but quickly turned against the Islamic government as a whole.

There were even chants in favour of the monarchy toppled by the Islamic revolution of 1979, while others criticised the government for supporting the Palestinians and other regional movements rather than focusing on problems at home.

State news channel IRINN said it had been banned from covering the protests that spread to towns and cities including Qom and Kermanshah.

"The enemy wants once again to create a new plot and use social media and economic issues to foment a new sedition," Ayatollah Mohsen Araki, a prominent cleric, told a crowd in Tehran, according to the conservative Fars news agency.

Other officials also pointed the blame outside Iran.

"Although people have a right to protest, protesters must know how they are being directed," Massoumeh Ebtekar, vice president in charge of women's affairs, wrote on Twitter.

She posted images from Twitter accounts based in the United States and Saudi Arabia, voicing support for the Mashhad protests.

US President Donald Trump tweeted later that Iran's people wanted change and "oppressive regimes cannot endure forever".

Officials in Iran warned against dismissing the public anger seen in recent days.

"The country is facing serious challenges with unemployment, high prices, corruption, lack of water, social gap, unbalanced distribution of budget," tweeted Hesamoddin Ashena, cultural adviser to President Hassan Rouhani.

"People have the right for their voice to be heard."

There has been particular anger at welfare cuts and fuel price increases in the latest budget announced earlier this month.

Since the 2009 protests were ruthlessly put down by the Revolutionary Guards, many middle-class Iranians have abandoned hope of pressing for change from the streets.

But low-level strikes and demonstrations have continued, often on a sector-by-sector basis as bus drivers or teachers or workers from specific factories protest against unpaid wages or poor conditions.

Some of this week's protests were directed against financial scandals linked to unauthorised lending institutions that collapsed with the loss of hundreds of thousands of accounts.

Payam Parhiz, editor-in-chief of reformist media network Nazar, which broke the news of the Mashhad protests, said they were more focused on the economy than those in 2009, which were sparked by allegations of election-rigging.

Economic concerns

"Then, they were middle-class and their slogans went beyond economic matters to things like cultural liberties," he told AFP.

"Today, the concerns are economic. There are people who have lost their life savings. They will protest until their problems are resolved."

Since taking power in 2013, Rouhani has sought to clean up the banking sector and kickstart the economy, but many say progress has been too slow.

Aware that economic problems can quickly spiral into political chaos, officials from across the political spectrum have called for greater efforts to tackle poverty and the 12 percent unemployment rate.

"Solving people's economic problems is the chief priority in the country," tweeted Ebrahim Raisi, the hardline cleric defeated by Rouhani in May's presidential election.