Anti-government protesters demonstrated in Iran in defiance of a warning by authorities of a tough crackdown, extending for a fourth day one of the most audacious challenges to the clerical leadership since pro-reform unrest in 2009.

Giving his first public reaction to the protests, President Hassan Rouhani appealed for calm, saying Iranians had the right to protest and criticise the authorities.

But he warned, according to official media: "The government will show no tolerance for those who damage public properties, violate public order and create unrest in the society."

Tens of thousands of people have protested across the country since Thursday against the Islamic Republic's government and clerical elite.

Police in the centre of Tehran fired water cannon to try to disperse demonstrators, according to pictures on social media.

Demonstrations turned violent in Shahin Shahr in central Iran.

Videos showed protesters attacking the police, turning over a car and setting it on fire. Reuters could not immediately verify the authenticity of the footage.

There were also reports of demonstrations in the western cities of Sanandaj and Kermanshah as well as Chabahar in the southeast and Ilam and Izeh in the southwest.

Demonstrators initially vented their anger over economic hardships and alleged corruption, but the protests took on a rare political dimension, with a growing number of people calling on Supreme Leader Ayatollah Ali Khamenei to step down.

Iranian security forces appear to have shown restraint to avoid an escalation of the crisis. Two people have been killed and hundreds arrested.

The protests were the biggest since unrest in 2009 that followed the disputed re-election of then-President Mahmoud Ahmadinejad.

Videos showed people in central Tehran chanting: "Down with the dictator!" in an apparent reference to Khamenei.

The government said it would temporarily restrict access to the Telegram messaging app and Instagram, owned by Facebook Inc, state television said.

There were also reports that mobile access to the internet was being blocked in some areas.

"Iran, the Number One State of Sponsored Terror with numerous violations of Human Rights occurring on an hourly basis, has now closed down the Internet so that peaceful demonstrators cannot communicate. Not good!" US President Donald Trump tweeted.

British foreign minister Boris Johnson tweeted that it was "vital that citizens should have the right to demonstrate peacefully".

The protests are the biggest since unrest in 2009 that followed the disputed re-election of then-President Mahmoud Ahmadinejad.

Demonstrators denounced high prices, corruption and mismanagement.

Unemployment stood at 12.4% in this fiscal year, up 1.4 points from the previous year.

About 3.2 million Iranians are jobless, out of a total population of 80 million.

The demonstrations are particularly troublesome for Mr Rouhani's government because he was elected on a promise to guarantee rights to freedom of expression and assembly.

His main achievement is a deal in 2015 with world powers that curbed Iran's nuclear programme in return for a lifting of most international sanctions.

But it is yet to bring the economic benefits the government promised.

"Those who damage public property, violate law and order and create unrest are responsible for their actions and should pay the price," state media quoted the country’s Interior Minister as saying.

No political party had urged Iranians to take to the streets and opposition leaders who galvanised Iranians during 2009 are under house arrest.

In addition, the range of slogans seen at the protests suggests discontent across social classes with government policies.

Iran has a dual system of clerical and republican rule, in which each faction vies for control.

The supreme leader rules for life and is commander-in-chief of the armed forces. He also appoints the head of the judiciary and, in all, has more power over foreign and economic policy than the elected president.

Analysts say Iran's leaders believe they can count on the support of many from a generation that took part as youths in the 1979 revolution and the ensuing eight-year war with Iraq to continue to defend the Islamic system, despite their advancing age, because of their ideological commitment and the economic gains they have made under the government.

In apparent response to the protests, the government backed down on plans to raise fuel prices, promised to increase cash handouts to the poor and create more jobs in coming years.

Protesters also expressed anger over costly interventions in Syria and Iraq, where Iran is engaged in a proxy war for influence against regional rival Saudi Arabia.