The killing of the secular blogger, who uses the pen name Niloy Neel, was at least the fourth this year targeting those who posted online pieces critical of Islam.
In addition to police, Imran Sarker, who heads the Blogger and Online Activists' Network in the nation, confirmed the attack.
Neel wrote posts condemning the recent killings of three other bloggers in his country. He also routinely posted on women's and minority rights, communal violence and the oppression of Hindus in Bangladesh.
Dhaka Police spokesman, Muntashirul Islam, used a different name for the blogger, whom he referred to as Niloy Chakrabarti.
He was killed in his apartment Friday afternoon by a group of five or six men, the spokesman said.
"We know that Niloy used to work for nongovernmental organizations in the past but we are not aware of his journalistic identity. We are investigating," he added.
Ansar al-Islam Bangladesh, an al Qaeda group, has claimed responsibility for the killing.
In an emailed statement to local media outlets, Mufti Abdullah Ashraf, who claims to be the group's spokesman, said: "By the permission of Allah, this operation took place today. We declare war against these worst enemies of Allah and his messenger." CNN could not independently verify the authenticity of the statement.
Dhaka police spokesman Muntashirul Islam told CNN that Ansar al-Islam "is not an active group in Bangladesh and is a relatively new name to us." He said investigators "are working to find out about the credibility of the group and the claim."
Neel, who was unmarried and in his late 20s, had been threatened by Islamic extremists before.
He contributed to the Mukto-Mona (Freethinker) humanist blogging platform established by Avijit Roy, who was murdered in February.
Rights group Amnesty International urged Bangladesh's government to send a strong message that killings aimed at silencing dissent are "despicable" and will not be tolerated.
"This spate of savage killings must end here," said David Griffiths, South Asia research director at Amnesty International.
"There is little doubt that these especially brutal killings are designed to sow fear and to have a chilling effect on free speech. This is unacceptable."
The British Humanist Association said Neel's murder "shows a new degree of daring on the part of extremists in Bangladesh," carried out as it was in his own home rather than on the street.
"This latest murder demonstrates once again if further proof were needed that the culture of impunity for these Islamist vigilantes in Bangladesh has become firmly entrenched," said chief executive Andrew Copson.
'Hit list' published
Neel's death is part of a highly disturbing trend.
In May, Ananta Bijoy Das, 32, was hacked to death
with cleavers and machetes
as he left his home on his way to work at a bank.
In March, Washiqur Rahman, 27, was hacked to death
by two men with knives and meat cleavers just outside his house as he headed to work at a travel agency in Dhaka.
A month earlier, Roy, a Bangladesh-born American blogger, was similarly killed with machetes and knives
as he walked back from a book fair in Dhaka.
In 2014, Reporters Without Borders reported that a group calling itself Defenders of Islam in Bangladesh had published a "hit list" of writers it saw as opposing Islam.
"They listed 84 bloggers, mostly secularists. They listed 84 of them," said blogger Asif Mohiuddin, whose name was on the list. "Nine of them are already killed and many of them were attacked."