The body of Mr Avijit Roy, founder of Mukto-Mona [Free-mind] blog site which champions liberal secular writing in the Muslim-majority nation, was found covered in blood after the attack which also left his wife critically wounded.
"He died as he was brought to the hospital. His wife was also seriously wounded. She has lost a finger," local police chief Sirajul Islam said.
The couple were on a bicycle rickshaw, returning from a bookfair, when two assailants stopped and dragged them onto a sidewalk before striking them with machetes, local media reported citing witnesses.
Mr Roy, said to be around 40, is the second Bangladeshi blogger to have been murdered in two years and the fourth writer to have been attacked since 2004.
Hardline Islamist groups have long demanded the public execution of atheist bloggers and sought new laws to combat writing critical of Islam.
"Roy suffered fatal wounds in the head and died from bleeding... after being brought to the hospital," doctor Sohel Ahmed told reporters.
Police have launched a probe and recovered the machetes used in the attack but could not confirm whether Islamists were behind the incident.
But Mr Roy's father said the writer, a US citizen, had received a number of "threatening" emails and messages on social media from hardliners unhappy with his writing.
"He was a secular humanist and has written about ten books" including his most famous "Biswasher Virus" [Virus of Faith], his father M Ajoy Roy told AFP.
The Center for Inquiry, a US-based charity promoting free thought, said it was "shocked and heartbroken" by the brutal murder of Mr Roy.
"Dr Roy was a true ally, a courageous and eloquent defender of reason, science, and free expression, in a country where those values have been under heavy attack," it said in a statement.
Mr Roy's killing also triggered strong condemnation from his fellow writers and publishers, who lamented the growing religious conservatism and intolerance in Bangladesh.
"The attack on Roy and his wife Rafida Ahmed is outrageous. We strongly protest this attack and are deeply concerned about the safety of writers," Mr Imran H. Sarker, head of an association for bloggers in Bangladesh, told AFP.
Mr Pinaki Bhattacharya, a fellow blogger and friend of Roy, claimed one of the country's largest online book retailers was being openly threatened for selling Mr Roy's books.
"In Bangladesh the easiest target is an atheist. An atheist can be attacked and murdered," he wrote on Facebook.
Atheist blogger Ahmed Rajib Haider was hacked to death in 2013 by members of a little known Islamist militant group, triggering nationwide protests by tens of thousands of secular activists.
After Haider's death, Bangladesh's hardline Islamist groups started to protest against other campaigning bloggers, calling a series of nationwide strikes to demand their execution, accusing them of blasphemy.
The secular government of Prime Minister Sheikh Hasina reacted by arresting some atheist bloggers.
The government also blocked about a dozen websites and blogs to stem the furor over blasphemy, as well as stepping up security for the bloggers.
Bangladesh is the world's fourth-largest Muslim majority nation with Muslims making up some 90 percent of the country's 160 million people.
A tribunal has recently handed down a series of verdicts against leading Islamists and others for crimes committed during the war of independence from Pakistan in 1971.