Thousands protested against police across Bangladesh on Monday, a day after at least four people died when officers fired on a crowd in one of the country's deadliest religious riots to date.

Some 20,000 Muslims called for the execution of a young Hindu man on Bhola island Sunday for writing Facebook messages that allegedly defamed the Prophet Mohammed, with police saying they opened fire after rocks were thrown at officers.

Four people died and nearly 50 were injured, with at least seven in a critical condition in hospital.

Protesters took to the streets of Dhaka angry at police who fired on a crowd on Sunday leaving four dead
Protesters took to the streets of Dhaka angry at police who fired on a crowd on Sunday leaving four dead AFP / Munir UZ ZAMAN

Mob attacks over online posts perceived to be blasphemous have emerged as a major headache for security forces in Bangladesh, where Muslims make up some 90 percent of the country's 168 million people.

The deaths sparked a new round of protests late Sunday and on Monday as thousands of Muslims across several cities shouted slogans and called for the officers involved to be put on trial.

"This is not acceptable. Police have illegally and unconstitutionally opened fire on the protesters," 22-year-old madrasa student Mahmudul Hasan told AFP at a rally in the capital Dhaka.

"It is an extrajudicial killing. We seek justice."

Mob attacks over online posts perceived to be blasphemous have emerged as a major headache for security forces in Bangladesh
Mob attacks over online posts perceived to be blasphemous have emerged as a major headache for security forces in Bangladesh AFP / Munir UZ ZAMAN

The Hindu man whose Facebook account hosted the original messages and is from Bhola, was charged with inciting religious tension.

But Prime Minister Sheikh Hasina called for calm Sunday and said the man's Facebook account was hacked by a Muslim person and used to "spread lies".

Thousands of protesters who took part in the Bhola protest were being investigated, local police chief Enamul Haque told AFP, adding a police officer was also "fighting for his life" after he was shot by demonstrators.

No arrests have yet been made, he added.

This is not the first time alleged Facebook posts have sparked large-scale religious violence in the impoverished South Asian country.

In 2016, angry Muslims attacked Hindu temples in an eastern town over a Facebook post that allegedly mocked one of Islam's holiest sites.

And in 2012, Muslim mobs torched Buddhist monasteries, houses and shops in the coastal Cox's Bazar district after a photo of the koran that was considered defamatory was put online by a young Buddhist.