The Iran that emerged after its long and bloody war with Iraq in 1988 was not one envisoned by those who rose to power after the overthrow of the Shah in 1979.
The revolutionaries, although hostile to the workers’ councils that sprang up during the revolution, imagined an equal society, where the pious worker would be able to put food on the table.
In this new Iran the leaders would be constrained by the tenets of Islam. Gone would be the opulence of the Shah and the old ruling class.
Many of those who took part in the revolution still live humble lives and reject the temptations of wealth.
But, as Iran developed economically, a new class associated with one section of the regime grew increasingly wealthy.
At the heart of the economy are the so-called Bayad Mostazafin, business concerns that blur the lines between the state and private capital. These organisations have special access to foreign currency reserves and are exempt from taxes and audits.
The Bayads control vast sections of the economy, including the manufacturing industries, trade and giant construction projects. This network touches all aspects of Iranian life, even prostitution.
The conglomerates have come under criticism for diverting vast amounts of oil wealth into huge projects in the Gulf states while many people in Iran are finding it hard to make ends meet.
They have been the main beneficiaries of Iran’s privatisation process. Among the most powerful clerics associated with the Bayads is Hashemi Rafsanjani, the man defeated by Ahmadinejad in the 2005 elections.
Rafsanjani’s family controls a network of concessions including oil, construction, trade and agriculture. He is said to have made a fortune from his stake in the state-owned car industry.
Sanctions have left the Iranian economy isolated for the most part, but often by using intermediaries it has managed to build vast modern factories with help from France and Germany.
Yet these suffer from low productivity, and would fare badly if the economy opened up fully to global markets.
Iranian bosses have been attempting to drive through efficiency programmes to overcome this problem. This has led to massive attacks on the wages and conditions of workers, and left millions in poorly paid and insecure jobs.
Iran had a big working class in 1979, but it has grown immeasurably since the revolution. It is now estimated that 500,000 workers are involved in the car industry.
The Iran Khodro car plant in Tehran, built with the help of Peugeot, is one of the biggest factories in the Middle East.
The majority of workers are young, overworked and underpaid. Around 65 percent of Iranians are under the age of 25. The schools and universities churn out millions of highly educated people, many of whom cannot find a decent job.
When they do find jobs it is often at the expense of older workers employed on permanent contracts. Young workers have to sign so-called “blank contracts” that waive their rights over wage rises, working hours and holiday entitlement.
It is predicted that within a few years some 90 percent of Iranian workers will be hired under these blank contracts.
In 2006 the Iranian parliament began drawing up new regulations that would extend the scheme to part-time and temporary workers.
President Ahmadinejad backed these changes, which even the government-run unions found unacceptable.
Until the latest waves of mass demonstrations the biggest threat to the regime was growing militancy among workers.
This has been on the rise since 2004. It has seen mass strikes by brick makers, textile workers and in the assembly plants. These strikes are usually sparked by a delay in wages.
In 2004 workers at the Khodro car plant went on unofficial strike after the deaths of several night shift workers. Despite heavy repression by factory security guards the strikes continued, raising further demands over the hated temporary contracts.
Teachers joined the strike wave, centred mainly in Esfahan, where 800 schools came out on strike. The strike also spread to 400 schools in Tehran.
In October 2005 there were 140 strikes, three times the number in the whole of 1999. These strikes often elected unofficial committees that formed the basis of informal workers’ associations.
After the revolution, charities and endowment organisations were put in place as a form of welfare safety net.
These organisations have since been transformed into centres of patronage, leaving many of the destitute at the mercy of unaccountable officials.
Ahmadinejad was able to tap into the growing mood of anger during his 2005 election campaign. He secured some 60 percent of votes in the second round against the unpopular Rafsanjani by presenting himself as a man of the people.
Ahmadinejad may have refused to move to the presidential palace that had belonged to the Shah, but he is not a political outsider.
He rose to prominence during the Iran-Iraq war by purging dissenters and oppositionists. Once he became president he appointed many of his allies to important roles, including the mayor of Tehran and the head of the interior ministry.
His pledges to put “food on the table” came to little. Oil money was used to buy patronage and recruit his supporters into the Basij militia.
He rearmed them and extended their powers. The first test of the new president’s attitude towards workers came shortly after he was sworn in.
Tehran’s mayor unleashed the Basij on the city’s bus drivers who were attempting to form an independent union. The militia arrested the drivers and their families, and seriously maimed union leader Mansour Ossanlou.
For these workers, Ahmadinejad came to represent a continuation of the regime, but in a harsher form.
Sections of the establishment, such as those allied to Rafsanjani, considered Ahmadinejad to be a dangerous man forming rival centres of power.
But many in the Guardian Council, the highest body in the country, see him and the Basij as a bulwark against the growing dissatisfaction in the country.
The ruling class fears that the popular movement could spill over into the factories. As yet this has not happened.
After all, it was the strikes by oil workers in 1979, after months of street clashes, which marked the end of the Shah’s regime.