A prominent Egyptian blogger who was imprisoned for four years for insulting Islam and defaming President Hosni Mubarak has been released.
The case of Abdel Kareem Nabil Soliman, often known as Kareem Amer, highlighted early government restrictions on political bloggers.
He was the first Egyptian convicted specifically for his writing online.
Human rights groups and opposition figures had campaigned for him to be freed.
The Arabic Network for Human Rights Information (ANHRI), which represented the blogger in court, said he was in bad health and was beaten by security officers in Alexandria before his release on Tuesday.
"We are of the opinion that he shouldn't have been tried for his opinions and that it was an unfair trial," said the head of ANHRI, Gamal Eid.
"Now we are also looking for a full investigation from the general prosecutor because Kareem was beaten twice - once when he was in prison in 2007 and the second time a week ago as Kareem was held for 11 days beyond the end of his sentence."
A Ministry of Interior source confirmed the date of the blogger's final release but denied he was beaten.
Mr Soliman, 26, a former law student at al-Azhar University, a state-run, religious institution was arrested in 2006.
He was accused of posting blogs that insulted Mr Mubarak by calling him a "dictator" and incited hatred of Islam.
He had called al-Azhar, "the university of terrorism", and accused it of promoting radical ideas and suppressing free thought.
The university expelled him and pushed prosecutors to put him on trial.
According to the Free Kareem website set up by supporters, the blogger spent 1,470 days behind bars. It expressed gratitude to all who backed Mr Soliman through his ordeal.
"Thanks for everyone who has protested, rallied, supported, donated, written, shared or even tweeted anything about Kareem from all over the world!" it read.
Another blogger, Muhammad Mari, who met Mr Soliman after he was also imprisoned, sent him the message: "Congratulations on your freedom."
Mr Soliman is now said to be resting and considering his future. He is expected to make a statement to the media next week.
His release comes as the Egyptian government has cracked down on the media in the run-up to the country's 28 November parliamentary elections.
Activists say that his ordeal highlights concern by the Egyptian government over dissident voices emerging on websites and online social networks that are less easy to control.
"The internet is still a big arena for human rights activism and political activism. It still offers a limited amount of freedom," commented well-known blogger Wael Abbas.
"They want to put us back to a time when everyone was working anonymously on the internet and operating underground because this limits credibility for bloggers. But even if we have to work with restrictions we will not stop."