(CNN) -- A blogger who endured a four-year stint in an Egyptian prison for his writings has been released, saying he was jailed for defying convention.

Abdel Kareem Nabil -- known by his blogger name, Kareem Amer -- is a self-proclaimed secularist who was convicted and imprisoned by Egypt for "spreading information disruptive of public order and damaging to the country's reputation," "incitement to hate Islam" and "defaming the president of the republic," according to a statement from the Committee to Protect Journalists.

The former law student at Cairo's Al-Azhar University is a critic of conservative Muslims and has accused his school of promoting extremist ideas, calling Egyptian president Hosni Mubarak a "dictator," it said.

Nabil was released from prison November 16.

The now famous blogger said he was jailed because he challenged tradition.

"There are things we inherit without even thinking about them," Nabil said. "I tried to change my way of thinking.

"I tried to read what was forbidden in our house, things written by people who in my home and in religious institutions are considered infidels."

Nabil had at times been kept in solitary confinement, largely prohibited from communicating with his lawyers until late January, according to an Amnesty International statement.

His time in prison has rendered him a cause celebre among bloggers and other advocates of free expression.

But the former law student is not the only blogger to be arrested for expressing controversial views in Egypt.

In January, police detained Al-Jazeera producer Howayda Taha Matwali after her work on a documentary that examined alleged torture in Egyptian police stations, the statement said.

An Egyptian court found Matwali guilty of "harming Egypt's national interest" and "falsely depicting events," sentencing her in absentia to six months in prison, it said.

Others, like Egyptian blogger Wael Abbas, say they have faced cyber attacks from state security for years.

"There are troubles that start online," he said. Abbas blames the Egyptian government for "trying to hack your website, trying to block it, trying to disable your account by sending fake reports that you're posting inappropriate material like they did with my you-tube, with my email, with my facebook."

While the internet is among few spaces where Egyptians can express themselves freely, it is far from risk-free.

Upon his release, Nabil told reporters that police officers beat him just before he left prison, sending him off with a warning not to blog again.