A previously unknown Islamist militant group named Ansar Bangla 7 claimed responsibility for the attack, according to the Associated Press, saying on Twitter that Roy was targeted "because of his crimes against Islam."
Roy, who was based in the United States, had just arrived in Bangladesh a week prior to attend a book festival. An engineer by training, he had launched a popular, secularist blog and gained a reputation as a prominent advocate of humanism and tolerance. His Hindu background was less relevant than his scientific atheism. Friends claimed he had received numerous death threats from fundamentalists irked by his outspoken commentary on religion.
"I have profound interest in freethinking, skepticism, philosophy, scientific thoughts and human rights of people," Roy wrote on his Facebook page, by way of biographical description. In a post on his Mukto-Mona blog, Roy, 42, questioned the credibility of the Koran, challenging the contention of some Islamic scholars that there's any "scientific" merit to the text.
Following the hideous terror attacks on a school in the Pakistani city of Peshawar and on the Paris offices of satirical newspaper Charlie Hebdo last month, Roy likened religion to a virus in a tweet.
Such sentiments proved too dangerous in Bangladesh's complicated milieu. The country has one of the largest populations of Muslims in the world, and Islam is enshrined as a state religion. In 2013, another secular blogger, Ahmed Rajib Haider, was killed by extremists, sparking similar free speech protests as Roy's death prompted this week.
But Bangladesh also has a deep tradition of secularism — the country broke away from Pakistan following a bloody war in 1971. Bengali nationalism, harbored also by the country's religious minorities, trumped the pan-Islamism that defined the Pakistani state. Bangladesh does not have blasphemy laws on its books, nor are there any official shariah courts.
The current government of Prime Minister Sheikh Hasina has embarked on a controversial, criticized crackdown of Islamists in the country, which included prominent politicians who had sided against the country's independence four decades ago. This effort was cheered by mass pro-democracy, anti-fundamentalist protests in 2013.
But Hasina has not helped the cause of liberal thinkers like Roy — and is accused of instituting a creeping authoritarianism where dissent and free speech is curtailed. Her opponents, including the country's main Islamist party, have been frozen out of parliament. As they fume along the margins, there are fears of increasing militancy and radicalization.
Bangladesh's toxic culture of zero-sum politics has led to a long, twisted history of extrajudicial violence, assassinations and street protests paralyzing the country's political life. Roy's killers may have hated him for his views on Islam, but they operated in a far larger, fraught context.
Bangladesh "is becoming a land where assassins feel emboldened," writes Salil Tripathi, an Indian journalist based in London who is a prolific commentator on Bangladeshi affairs. "[They] act with impunity while writers are forced to watch what they speak, keeping their thoughts imprisoned in their minds."