Forty-year-old Roy and his 36-year-old wife, Rafida Ahmed Bonna, had been walking near Dhaka University when they were attacked on Thursday night after visiting the Amar Ekushey Book Fair just before 9:00 p.m. local time (1500 UTC) by unidentified assailants wielding machetes.
Roy died of his injuries an hour after being admitted to Dhaka Medical College and Hospital. His wife is still in hospital.
"He died as he was brought to the hospital. His wife was also seriously wounded in the attack. She has lost a finger," local police chief Sirajul Islam told AFP news agency.
Roy's blog, mukto-mona.com, was inaccessible at the time of publication, delivering a 404 error message (usually meaning a site has been removed or relocated).
Atheist blogger, government critic
Roy was well known for his writings on philosophy and human rights issues. He was also an atheist and government critic and had been accused by Islamists thought to have links to the militant Hefazat-e-Islam group of insulting he Prophet Muhammad and defaming Islam. He received numerous death threats prior to his killing.
He penned a number of controversial books including Samakamita (Homosexuality) and Obiswasher Darson (Philosophy of Atheists).
"Roy became target of the fundamentalists groups when his books ... hit the stands a few years ago," his publisher, Ahmed Rashid Tutul, told dpa news agency.
Last year, an online bookstore stopped selling books written by Roy after receiving death threats on its Facebook site.
Online activists targeted
Islamist groups are targeting bloggers in Bangladesh, who are using online platforms as a means of free speech in an otherwise restricted setting; large-scale "Shahbag protests" in the capital Dhaka in 2013 between bloggers, Islamists and government supporters led to a crackdown on inflammatory speech - online and off.
Just days after the Shahbag protests kicked off, in February 2013, the famous atheist blogger Ahmed Rajib Haider was hacked to death by Islamist militants. Prior to his death, he had written comments about religious fundamentalism.
The well-known writer and government critic Taslima Nasreen, who is living in exile in India for fear of her life, wrote on Twitter:
Author Roy was also prolific online; his blog had been selected as a nominee for the 2014 Deutsche Welle Bobs award for online activism.
DW editor for Bengali language Bobs entries, Arafatul Islam, said these kinds of attacks on bloggers in Bangladesh were becoming increasingly common.
"There has been a trend over the past three years. A Bobs winner, Asif Mohiuddin, was attacked and critically injured in Dhaka as well." He added that there were similarities in the way the attacks were carried out. He explained that the activists receive death threats, usually online, before they are attacked.
"There is evidence that the assailants have ties to terrorist groups," he said.