A blogger has been hacked to death in Bangladesh's capital by three men over alleged anti-Islamic writings, with two of the suspected attackers caught near the scene, police have said.

Dhaka Metropolitan Police official Biplob Kumar Sarker said that Monday's attack on Washiqur Rahman Babu took place in Dhaka's Tejgaon area, and that doctors declared him dead as he was taken to a government hospital shortly after.

Sarker said that two suspects were captured and that three meat cleavers were recovered.

He said the captured suspects were students at separate schools. The third suspect fled the scene.

Sarker said it was not immediately known what sort of blogging he did.

He said the suspects told police them that they targeted him for disrespecting the Prophet Mohammed.

"I stabbed him because he humiliated my prophet," said Jikrullah, a 20-year-old student at Hathajari Madrassah in the southeastern district of Chittagong, without elaborating.

Jikrullah said he travelled from Chittagong and stayed overnight at a mosque to attack Babu.

The other detained suspect, Ariful Islam, also 20, is a student at an Islamic school in Dhaka's Mirpur area. They named a third suspect, but details about him were not available.

The killing took place nearly one month after a prominent Bangladeshi-American atheist blogger was hacked to death in Dhaka by unidentified assailants.

Avijit Roy, a Bangladesh-born US citizen, died after he was attacked on February 27 at Dhaka University's campus when he was leaving a book fair with his wife.

A previously unknown armed group, Ansar Bangla 7, claimed responsibility for that attack.

Detectives have arrested one suspect in the case. The US Federal Bureau Investigation is assisting Bangladeshi police with the investigation.

Source: AP