The country's supreme leader has also ordered a jail closed amid allegations of prisoner abuse.
Iranian authorities on Tuesday freed 140 people detained in street protests over last month's disputed election and President Mahmoud Ahmadinejad said he wanted them all released soon.
In what was seen as a gesture to the opposition campaigning against Ahmadinejad's re-election, Iran's supreme leader Ayatollah Ali Khamenei also ordered a jail closed amid allegations of prisoner abuse.
Ahmadinejad, in his first comments about the protesters who rose up against him, told the country's judiciary chief to free any detained demonstrators not facing serious charges.
"We want their families to be happy by their release. They should be home for the occasion of the birth anniversary of Imam Mahdi which falls on August 7," he said in a letter to Ayatollah Mahmoud Hashemi Shahrudi.
Ahmadinejad urged Shahrudi to show "maximum Islamic compassion," saying those arrested were "provoked by some people and some political groups who were backed by the propoganda made by our enemies."
Iranian authorities on Tuesday freed 140 protesters held in the notorious Evin prison in Tehran, according to a member of a parliamentary panel who visited the detainees.
"We had an intensive meeting with Tehran prosecutor (Saeed Mortazavi) and 140 detainees of the recent events were freed," MP Kazem Jalali said in a statement to the ISNA news agency.
Around 200 people remain in detention, including 50 "politicians, members of anti-revolutionary groups and foreigners" who he said were suspected of masterminding riots.
But in a blow to the opposition, the authorities refused to issue a permit for a planned mourning ceremony for those slain during the worst crisis to rock Iran since the Islamic revolution three decades ago.
"It is unprecedented for anyone to seeks permission for a memorial from the interior ministry unless they are pursuing a political aim," an interior ministry official said.
Farhad Tajari, the deputy head of parliament's judicial commission said "30 people at most" were killed in the unrest that erupted after the June 12 election, branded a fraud by Ahmadinejad's defeated rivals.
Security forces including police and the Islamic Basij militia cracked down on demonstrators as they poured on to the streets of Tehran and other cities to oppose Ahmadinejad's election victory.
The post-election turmoil and the crackdown on the opposition has exposed deep rifts among the ruling elite and has led to political tensions that have weakened Ahmadinejad's standing even among his own hardline supporters.
Khamenei also ordered the closure of a detention centre holding protesters which was not up to "required standards," said the secretary of Iran's National Security Council, Saeed Jalili.
"The supreme leader has issued a strict order to ensure there is no injustice committed against anyone in the aftermath of the recent events."
The head of Tehran prisons, Sohrab Soleimani, denied that two protesters had died from prison beatings, insisting they had been struck down by meningitis.
But opposition leader Mirhossein Mousavi, Ahmadinejad's closest rival, said that if one of the protesters had died of meningitis, "how come his teeth were broken?"
The reformist Sarmayeh newspaper also reported that the life of Saeed Hajjarian, an advisor to former president Mohammad Khatami being detained in Evin prison, was in danger.
"He looked pale... very weak and seriously depressed... He had a foul body odour and said he had been kept in the sun as a pressure tactic," Hajjarian's wife Vajiheh Marsoosi was quoted as saying.
Tajari said Hajjarian would also be freed soon.With Iran's political situation still volatile, MPs have drawn up a bill limiting the autonomy of four vice presidents after a row with Ahmadinejad over his choice of a first vice president, the Mehr news agency said.
Unlike ministers, Iran's vice presidents are not subject to a vote of confidence or impeachment by parliament.The move came after a crisis over Ahmadinejad's initial refusal to sack a controversial aide, Esfandiar Rahim Mashaie, who he had appointed as first vice president despite strong opposition even from his own hardline camp.
Ahmadinejad budged only after Khamenei ordered him to fire Rahim Mashaie, but he subsequently sacked intelligence minister Gholam Hossein Mohseni Ejeie, another move that drew the ire of conservatives.