ALEXANDRIA, Egypt, Feb. 22 -- An Egyptian blogger was convicted Thursday and sentenced to four years in prison for insulting Islam and Egypt's president, sending a chill through fellow Internet writers who fear a government crackdown.

Abdel Kareem Nabil, a 22-year-old former student at Egypt's Al-Azhar University, had been a vocal secularist and sharp critic of conservative Muslims in his blog. He often lashed out at Al-Azhar -- the most prominent religious center in Sunni Islam -- calling it "the university of terrorism" and accusing it of encouraging extremism.

Nabil's attorney, Ahmed Seif el-Islam, said he would appeal the verdict, adding that it will "terrify other bloggers and have a negative impact on freedom of expression in Egypt." Nabil had faced a possible maximum sentence of nine years in prison.

His conviction brought a flood of condemnations from international and Egyptian rights groups, as well as fellow government critics on the Internet.

The New York-based Committee to Protect Journalists said Internet writers and editors are the fastest-growing segment of imprisoned journalists, with 49 behind bars as of December.

Judge Ayman al-Akazi sentenced Nabil to three years in prison for insulting Islam and the prophet Muhammad and inciting sectarian strife, and another year for insulting President Hosni Mubarak.