Bangladeshi Prime Minister Sheikh Hasina on Sunday called for calm after at least four people were killed when police fired on thousands of people protesting Facebook messages that allegedly defamed the Prophet Mohammed.

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 per cent of the country’s 168 million people.

Some 20,000 Muslims demonstrated at a prayer ground in Borhanuddin town on the country’s largest island of Bhola to call for the execution of a young Hindu man charged with inciting religious tension through online messages.

Police said they opened fire in self-defence after some of the crowd threw rocks at officers.

“At least four people were killed and up to 50 people were injured,” police inspector Salahuddin Mia said, adding that extra police and border guards were rushed to the island on helicopters and deployed.

The death toll is expected to rise, with local doctor Tayebur Rahman saying that at least seven of the 43 people taken to the hospital were fighting for their lives.

Hasina said the Facebook account of the man charged with inciting religious tension was hacked by a Muslim person and used to “spread lies”.

“We saw rumours are being spread on Facebook to create an environment of anarchy. Who are they? What is their intention?

“I asked our countrymen to have patience. And those who want to fish in troubled waters, we will find them and take action against them.”

“We also suspect that his account was hacked and these contents were spread through Facebook Messenger,” Bhola’s deputy police chief Sheikh Sabbir said, adding that the charges have not been dropped.

In 2016, angry mobs attacked Hindu temples over a Facebook post that allegedly mocked one of Islam’s holiest sites.

In 2012, Buddhist monasteries, houses and shops were torched in Cox’s Bazar district after a Buddhist youth’s alleged defamatory photo post of the Quran.

Bangladesh has also experienced several attacks on people from religious minorities, secular bloggers, publishers, writers and foreigners, many claimed by Islamist militants.

The country ranked 25th in the Global Terrorism Index published on Trading Economics – just ahead of the US and Philippines but behind the UK, Colombia and Ethiopia.