Egypt's state news agency says the country's president has issued a law that bans imprisoning journalists pending trial for publishing-related charges.

Thursday's decree is the first law issued by President Mohammed Morsi since he assumed legislative powers this month in the absence of a parliament, and after he sent the generals with whom he had shared powers into early retirement.

A Cairo court on Thursday had ordered the editor of the privately-owned el-Dustour daily, Islam Afifi, detained pending trial on charges that his newspaper had insulted Morsi and potentially harmed the public interest.

Following Morsi's decree, MENA reported that Afifi was ordered released from prison.

Rights groups had expressed indignation at the court's decision, saying it betrayed the values of last year's revolt against Egypt's longtime former President Hosni Mubarak.