The former prosecutor, Saeed Mortazavi, was detained shortly after his political ally, President Mahmoud Ahmadinejad, publicly accused Parliament Speaker Ali Larijani's family of attempting to use their prominence for financial gain.
No reason was given by prosecutors for Mortazavi's arrest, but its timing suggested it was linked to the accusations of corruption and as the most recent indication that Ahmadinejad has lost favour with Iran's most powerful authority, Supreme Leader Ayatollah Ali Khamenei.
On Wednesday, state news agency IRNA reported that Mortazavi had been released from prison, citing an anonymous source. It was unclear whether Mortazavi had posted any bail, IRNA said.
Mortazavi was suspended from his judicial post in 2010 over the torture deaths of three protesters in custody after the 2009 presidential elections, which the opposition claimed was rigged in Ahmadinejad's favour, bringing huge crowds into the streets.
Human Rights Watch has previously described Mortazavi as a "serial human rights abuser" whose "unsavory history goes back many years."
Labour Minister Abdolreza Sheikholeslami, who was dismissed by parliament on Sunday, appointed Mortazavi last year to head the social security office, against lawmakers' wishes.