A former Iranian prosecutor linked to the deaths of anti-government protesters and who is at the centre of a power struggle between the country's president and parliamentary speaker has been arrested, the Tehran prosecutor's office said.

No reason was given for the arrest of Saeed Mortazavi, who has played a key role in stamping out dissent following the disputed reelection of Mahmoud Ahmadinejad in 2009, and been described by Human Rights Watch as a "serial human rights abuser".

But the timing suggested it might be linked to his role in the dispute between Ahmadinejad –who is travelling to a summit in Egypt – and the parliamentary speaker, Ali Larijani, which has intensified with the approach of presidential elections.

The president was quoted as describing Mortazavi's detention as "very ugly" and saying it would be investigated on his return.

"The Tehran prosecutor announced Monday night that Saeed Mortazavi has been arrested," read a one-line statement from the prosecutor's office.

Iran's Fars news agency reported that Mortazavi was taken to Evin prison.

Mortazavi was Tehran city prosecutor in 2009 at a time of massive protests in the wake of Ahmadinejad's re-election. At the time, he was responsible for Kahrizak prison in the Iranian capital, where at least three anti-government protesters were tortured to death. He now heads the country's social security fund.

In 2010, a parliamentary investigation into the case found Mortazavi responsible for what had happened at Kahrizak. He was suspended as Tehran prosecutor general and the case remained open for a judicial investigation, though no further action was taken against Mortazavi.

The judiciary said earlier this year that the prison deaths would again be investigated in March.

Mortazavi's name surfaced in another context on Sunday, when Ahmadinejad accused the parliamentary speaker's family of corruption, deepening a long-standing rivalry between the two.

In a speech meant to defend one of his ministers against impeachment, Ahmadinejad played a tape he said showed a meeting between Larijani's brother Fazel and Mortazavi, in which Fazel Larijani attempted to use his family's prominent political status for financial gain.

Both Fazel and Ali Larijani denied the accusation of corruption, and Fazel Larijani said he would file a legal complaint against Ahmadinejad and Mortazavi. The head of Iran's judiciary is Sadeq Larijani, Fazel and Ali's brother.

"The judiciary is not a special family organisation," Ahmadinejad said, according to state news agency IRNA, an apparent reference to the deep influence of the Larijani family in Iran's power structure.

"I don't know how it has happened that one person has committed an infraction, and another person is arrested," he said. "Instead of going after the violator, they go after the person who has announced the violation, and this is very ugly."

Deep divisions remain within the highest levels of Iran's ruling class despite calls from Supreme Leader Ayatollah Ali Khamenei for officials to stop bickering and show unity ahead of presidential elections scheduled for June.

The Labour minister, Abdolreza Sheikholeslami, who was dismissed by parliament on Sunday, appointed Mortazavi last year to head the social security office, despite lawmakers' anger.

Dubbed by some as "the butcher of the press", Mortazavi had a central role in shutting down reformist newspapers and arresting dozens of journalists.

"Over the last decade, his name has been closely linked to most, if not all, of Iran's human rights related imbroglios," said Yasmin Alem, a US-based expert on Iran's electoral system.

"Now he is at the crux of a political fiasco that has brought all the regime's dark secrets to the surface."