Egyptian newspaper editor Islam Afifi was freed after a few hours in custody on Thursday, a security official said, following a presidential decree scrapping preventive detention for alleged publishing crimes.
A senior security official confirmed late Thursday that Afifi, who is facing charges of inciting disorder and spreading false news, was freed in line with the decree.
"He has been released from Tora prison and is on his way home," he told AFP.
It was the first time President Mohamed Morsi, who was inaugurated June 30 and stripped the military of legislative powers in August, issued a decree with the force of law, presidential spokesman Yasser Ali said, according to the official MENA news agency.
Afifi, editor of the small independent Al-Dustour newspaper, is the first journalist to go on trial since the overthrow of veteran strongman Hosni Mubarak in February last year.
Earlier on Thursday, a judge at the Giza Criminal Court in greater Cairo ordered Afifi held until his next hearing, which was set for September 16, pending investigations over charges that he had "insulted Morsi," MENA said.
Speaking to AFP before he was remanded in custody, Afifi said the trial was political.
"This trial will be a real test of one of the core demands of the Egyptian revolution, which was for freedom of expression," he said.
The Egyptian Press Syndicate, The Egyptian Organisation for Human Rights and Reporters Without Borders all condemned the court's decision to hold Afifi in custody and pressed for his immediate release.
"The judicial authorities are trampling on the desire for freedom that the Egyptian people expressed during the 2011 and 2012 protests," Reporters Without Borders said.
The Egyptian Organisation for Human Rights said his trial "runs counter to the new Egypt, which has an elected president and where there is a commitment to respect public liberties."
Afifi's case and that of television boss Tawfiq Okasha, accused of "incitement to murder" the president, has also prompted Washington to voice concern about press freedoms in post-Mubarak Egypt.
US State Department spokeswoman Victoria Nuland said last week that the prosecutions ran counter to the spirit of last year's revolution.
Okasha, who owns the private channel Al-Faraeen, on which he hosts a controversial talk show, is known to be staunchly anti-Islamist and opposed to Morsi.
Thursday's hearing came on the eve of protests against Morsi called by secular activists.
It also came after the president got the Muslim Brotherhood-dominated upper house of parliament to name new editors-in-chief for state media that had been hostile to him and the once-banned Islamist movement.
Several independent newspapers published blank editorial columns on August 9 to denounce the Muslim Brotherhood's encroachment on press freedoms.
The authorities on August 12 ordered copies of Al-Dustour seized after complaints that they contained remarks deemed insulting to Morsi, a move Afifi denounced as an attack on press freedoms.