CAIRO — An Egyptian blogger was sentenced Monday to three years in prison for criticizing the military in what human rights advocates called one of the more alarming violations of freedom of expression since a popular uprising led to the ouster of President Hosni Mubarak two months ago.

The blogger, Maikel Nabil, 25, had assailed the Egyptian armed forces for what he called its continuation of the corruption and anti-democratic practices of Mr. Mubarak. Mr. Nabil often quoted from reports by established human rights groups.

“Maikel is the first prisoner of conscience in Egypt after the revolution,” Adel Ramadan, one of his lawyers, said in a telephone interview. “This ruling is a warning to all journalists, bloggers and human rights activists in Egypt that the punishment for criticizing the army is a sentence in a military prison.”

Mr. Ramadan said that a military tribunal had sentenced Mr. Nabil to serve his term at Tora Prison here. His lawyers and his family were barred from communicating with him after the sentencing.