Iran's government said on Tuesday it would cap salaries for public officials as it seeks to dampen a scandal over exorbitant pay that has threatened to derail President Hassan Rouhani's re-election hopes.

The payslips of executives at several public companies were leaked in May, showing that many earned over 100 times more than the average worker.

One bank director was paid some $60,000 a month - compared with an average public sector salary of about $400.

He was sacked along with three other bank directors last month, and the entire management of Iran's development fund was forced to resign shortly after.

On Tuesday, the government said it would cap monthly salaries for public officials at 189 million rials ($6,100), and 100 million rials for those in political roles.

Any payment beyond these limits would be considered "a violation and crime and they will face prosecution under the law", said government spokesman Mohammad Bagher Nobakht.

The scandal has gripped the country and provided ammunition for the conservative media to attack moderate president Rouhani ahead of the next election, due around May next year.

It has added to criticism that the nuclear deal with world powers, which took effect in January, has brought few economic benefits to struggling Iranians.

The source of the leaked payslips is not clear, but one reformist official, Abdollah Nasseri, has claimed hardline opponents of the government have 3,000 payslips of top officials that they intend to use to discredit Rouhani ahead of the election.