Ethiopia's parliament on Tuesday approved a law to imprison people who distribute defamatory speech, pornography and spam online, a move that bloggers and activists said is meant to silence dissent.

The law's most severe penalty is 10 years' imprisonment for sharing pornography online. Sharing defamatory speech or spam gets at least three years in prison.

Ethiopia's cybersecurity officials have said the country is subject to more than 1,000 cyberattacks per day, and the government has said the new law will enable it to prosecute such crimes more efficiently.

But rights groups have accused the East African country of restricting freedom of expression and using spyware against dissidents living overseas. An Ethiopian court last month charged an opposition activist over his Facebook posts.

Daniel Berhane, a popular blogger, said the new law is a concern to him as an editor of a website that has several contributors and is an active user of social media.

"It jumbled provisions for cyberattacks with provisions about content, thereby paving the way for a heavy-handedness on online expression," he said.