A former Iranian prosecutor linked to the 2003 imprisonment, sexual assault and death of Iranian-Canadian photojournalist Zahra Kazemi has been released, a day after he was detained in the same prison where she died.

The Wednesday report by IRNA quotes an unnamed official as saying Saeed Mortazavi, a senior official who once served as Tehran's prosecutor general, has been released from Evin prison.

130-mortazavi-rtr2hq75

Saeed Mortazavi adjusts his hair as he attends an execution in 2007. (Morteza Nikoubazi/Reuters)

Kazemi was born in Iran but later became a Canadian citizen, living in Montreal. She was 54 years old when she died in Iranian custody on July 11, 2003, almost three weeks after her arrest for taking photographs outside a prison during a student protest in Tehran.

Iranian authorities reported Kazemi's death as accidental, but the attending physician, who fled Iran, reported Kazemi showed signs of torture, severe beating, head trauma and rape before her death.

Mortazavi was the prosecutor who sent Kazemi to the prison. He was named in a $17-million lawsuit by Kazemi's family for his role in her imprisonment, sexual assault and beating death. However, the case was dismissed by the Quebec Superior Court and the Quebec Court of Appeal.

Mortazavi at centre of internal Iranian dispute

Mortazavi was suspended as Tehran city prosecutor after an Iranian parliamentary probe found him responsible for the 2009 deaths of three anti-government protesters at the city's Kahrizak prison. While no other action was taken against Mortazavi, the country's judiciary has said the 2009 deaths will be reinvestigated in March.

During his time in the prosecution service, Mortazavi was reported to have earned the nickname Butcher of the Press for his role in the detention and abuse of journalists, bloggers and other dissenters.

Mortazavi was taken to prison at midnight Monday, and speculation soared that this was related to the prison deaths.

The former prosecutor has been at the centre of an escalating confrontation between President Mahmoud Ahmadinejad and his conservative rivals in parliament ahead of the June presidential election. There was no immediate indication of any charges against Mortazavi, who now heads the state Social Security Fund, and his release is seen as a decision to stave off an escalation among the country's senior officials.

Ahmadinejad on Tuesday denounced Mortazavi's arrest, saying he would pursue the case after his return from an Islamic summit in Cairo.

With files from The Associated Press