Huge counter-demonstrations have taken place against the protests in Iran with the head of the Revolutionary Guards declaring victory against “forces of sedition” which had sought to create “anarchy, insecurity and intrigue in the Islamic Republic”.

As what was described by the state media as “the revolutionary outburst of Iranian people against lawbreakers” took place in towns and cities, General Mohammad Ali Jafari announced that units of the Guards had been deployed in the three provinces of Isfahan, Lorestan and Hamadan, which had been the main centres of the demonstrations.

However, the week of marches and rallies which led to violence with 21 dead and more than 450 arrested has exposed deep divisions in the country which are likely to resurface. There are concerns that interference by the Trump administration may exacerbate political and economic situations in the future.

There is growing evidence that the days of upheaval were the result not just of economic hardship but the long-running power-struggle between hardliners and reformists, with groups outside the country attempting to exploit the violence.

It has emerged that Ayatollah Ahmad Alamolhoda, the father-in-law of Ali Raisi, the hardline candidate who lost in last year’s presidential campaign to the reformist Hassan Rouhani, has been ordered to appear before Iran’s National Security Council to be questioned about his role in a rally at Mashhad where the protests began last Thursday. Mr Alamolhoda has denied being ordered to appear, with his office calling such talk “rumours”.

Gatherings at Mashhad, a conservative Shia holy city, which is home to Mr Raisi and Mr Alamolhoda, started with slogans about rising prices which soon turned to ones against President Rouhani and his government.

Liberals claimed the rally was orchestrated by hardliners who lost control as demonstrations started across the country, with angry abuse directed at mullahs, the Supreme Leader Grand Ayatollah Ali Khamenei, the Revolutionary Guards and the Basij militia.

Iranian clerics take part in a state-organised rally against anti-government protests in the city of Qom, in south-west Iran (EPA)

But the publication of the government’s budget plans, including sections hitherto kept confidential, also appeared to have fuelled anger towards clerics and sections of the security forces.

They showed that billions of dollars of state money was going to hardline religious organisations, senior clerics and the Revolutionary Guards while cash subsidies were cut for the public, price of food and fuel rose, and public entities, including educational organisations, were privatised.

This was followed by a tweet from Hesamodin Ashna, a close advisor to President Rouhani, which focused on “the unbalanced distribution of budget” pointing out how much was being spent on religious institutions as well as the military.

Iranian forces are heavily engaged in Syria and in a much more limited capacity in Yemen. It is the expenditure incurred in these missions which are believed to have led to vocal criticism of aspects of foreign policy.

Many of those protesting stressed that their anger was not directed towards the Rouhani government, but the hardliners and the clergy.

The overall popular reaction may help the liberals in the long run, especially as the conservatives appear to be split.

Iranians march in support of the government in Tehran on 30 December (AFP/Getty)

General Jafari made a point of putting some of the blame for the disturbances on a “ former official”. This is believed to refer to Mahmoud Ahmadinejad, the populist hardline former president, who has been vocally critical of officials, in particular Sadegh Amoli Larijani, the powerful head of the judiciary, as well as President Rouhani.

There is, however, apprehension among reformers that attempts would be made by the hardliners to portray the protests as being directed by foreign powers.

Iran protests – in pictures Show all 11 1 /11 Iran protests – in pictures Iran protests – in pictures University students at an anti-government protest inside Tehran University, 30 December 2017 AP Iran protests – in pictures A university student at a protest inside Tehran University while a smoke grenade is thrown by anti-riot Iranian police, 30 December 2017 AP Iran protests – in pictures University students at a protest inside Tehran University, 30 December 2017 AP Iran protests – in pictures University students run away from the police during an anti-government protest inside Tehran University, 30 December 2017 AP Iran protests – in pictures An image grab taken from a handout video released by Iran's Mehr News agency reportedly shows a group of men pulling at a fence in a street in Tehran, 30 December 2017 AFP/Getty Iran protests – in pictures Demonstrators gather to protest in Tehran, 30 December 2017 AP Iran protests – in pictures Iranians chant slogans as they march in support of the government near the Imam Khomeini grand mosque in Tehran, 30 December 2017 AFP/Getty Iran protests – in pictures Iranians chant slogans as they march in support of the government near the Imam Khomeini grand mosque in Tehran, December 30 2017 Iran protests – in pictures Iranian clerics take part during a state-organized rally against anti-government protests in the country, in the holy city of Qom, south west Iran, 3 January 2018 EPA Iran protests – in pictures In this photo provided by the Iranian Students' News Agency, a clergyman takes a picture of a pro-government demonstration in the southwestern city of Ahvaz, Iran, 3 January 2018 ISNA via AP Iran protests – in pictures Pro-government demonstrators gather at the Massoumeh shrine in Iran's holy city of Qom, some 130 kilometres south of Tehran, 3 January 2018 AFP/Getty

Western European states have turned down a US plan to sign a joint declaration condemning the Iranian government. But Donald Trump has maintained his Twitter offensive, one of the latest instalments promising Iranian people unspecified help.

Sohrab Norouzi, a building contractor from Isfahan who wants economic reform, said: “That is the biggest worry, saying that we are being influenced by outsiders. No one in his right mind would take Trump seriously, but the principalists [conservatives] will use him to try and discredit genuine protest.

“I have not experienced this, but I have also heard that there have also been messages to cause trouble from some extremists outside the country. This is something we need to avoid as well.”

Grand Ayatollah Khamenei has blamed the protests on “enemies of Iran”, declaring “all those who are at odds with the Islamic Republic have utilised various means, including money, weapons, politics and intelligence apparatus to create problems for the Islamic system, the Islamic Republic and the Islamic Revolution”.