In the last week of February, Avjit Roy was hacked to death with machetes, in Dhaka, the capital city of Bangladesh. Roy was an American blogger of Bangladeshi origin. He ran a website called Mukto-Mano, or Free Mind, which championed liberal, secular writing in Bangladesh, where 90 per cent of the population is Muslim. He and his wife were on a bicycle rickshaw returning from a book fair when they were attacked. His wife survived but was critically wounded.

Roy is the second Bangladeshi blogger to have been murdered in two years, and is the fourth writer to have been attacked since 2004. In February 2013, blogger Ahmed Rajib Haider, a frequent critic of religious fundamentalism in Bangladesh, was hacked to death outside his house in Dhaka.

Like Haider, Roy had reportedly received death threats from Islamist groups. Some of these groups demand the public killing of atheist writers, and have sought new laws to deal with work that criticises Islam. After Haider’s death, thousands of secularist campaigners took to the streets. In response, Bangladesh’s Islamist groups stepped up their protests against other atheist bloggers, accusing them of blasphemy and calling for their deaths. Bangladesh’s government, technically secular, arrested some atheist bloggers and blocked around a dozen websites in an attempt to quell the tension about blasphemy. Simultaneously, security for bloggers was beefed up.

This somewhat incoherent action by the authorities points to the fact that journalists and bloggers in Bangladesh face a double threat: extreme violence from Islamist groups, but also official repression. This is aptly demonstrated by the case of Asif Mohiuddin, an atheist blogger who was stabbed several times in January 2013. He was seriously injured but survived the attack; only to be arrested a few months later for posting “offensive comments about Islam and Mohammed”.

Religious fundamentalism in Bangladesh does not attract much international attention, partly because of very tight restrictions on foreign journalists entering. There is also the fact that traditionally, this nation of 160 million hasn’t been home to any prominent extremist groups. But it appears that this is changing.

The political climate in the country is intensely polarised, a situation which provides fertile ground for extremism to grow. In 2013, there were protests by secularists and counter-protests by Islamists, which turned into riots. These heightened tensions were related to a war crimes tribunal which is prosecuting individuals for crimes dating back to the 1971 war of independence, when Bangladesh separated from Pakistan. Many of those standing trial are members of the Islamist party, Jamaat-e-Islami. Broadly, secularists support the death penalty for those on trial, while Islamists say the tribunals are being used to stamp out the opposition. The 2014 election was the bloodiest day in the country’s short history, with the opposition boycotting the poll as they claimed it would be rigged. On the one year anniversary of this day, 19 January, there was a resurgence of violence. The protests about the war crimes tribunal have turned into a broader disagreement about what kind of country Bangladesh wants to be.

Certainly, in this volatile and polarised context, extremist groups feel empowered to take vigilante action against bloggers and journalists. And there is no doubt that this spectre of violence is having a chilling effect. Back in 2013, a list of 84 bloggers deemed to be “blasphemous” was published by an Islamist group. Some of these bloggers stopped writing altogether for fear of being attacked or arrested.

“In Bangladesh the easiest target is an atheist. An atheist can be attacked and murdered,” Pinaki Bhattacharya, a blogger and friend of Roy, wrote on Facebook this week. The government should be working to protect these writers and the value of freedom of speech, rather than participating in the clampdown on “blasphemous” speech. Such a course of action merely allows the terms of the debate to be dictated by extremist groups. Police have arrested a suspect in Roy’s murder case. But it should not stop there; action must be taken to avoid others meeting the same fate.