The lawyer, Mohamed Ramadan, will also be banned from using the Internet for five years after completing his prison term, the judge said on Thursday. The court found him guilty of using Facebook to destabilize the general order" and "harm national unity and social peace" by insulting the Egyptian President Abdel-Fattah el-Sissi.

Previously, Ramadan's lawyers had asked for the court to postpone the case on medical grounds, but the judge denied their request and sentenced the defendant in absentia.

Defense attorney Mohamed Hafez said the ruling was "harsh" and a "message for all who criticize the regime."

Ramadan was sentenced under a controversial 2015 law, which forbids insulting the president and propagating ideas and beliefs that call for the use of violence on social media. Such actions are defined as a terror-related offense.

Amnesty International decried the sentence as "chilling" and labeled the law "draconian."

"It is utterly shocking that the Egyptian authorities have imposed such a heavy sentence against someone who was exercising his right to freedom of expression," said Najia Bounaim, Amnesty International's campaigns director for North Africa.

"Instead of locking up people for expressing their views online, the Egyptian government must end its relentless campaign to intimidate government critics."

Ramadan's lawyers will request a retrial, the watchdog said on their website.