A Bangladeshi blogger was hacked to death in Dhaka on Monday, the second such attack on a critic of religious fundamentalism in the mainly Muslim country in less than two months.

Three knife-wielding attackers set upon 27-year-old Washiqur Rahman near his home on Monday morning, weeks after the murder of an American atheist blogger in Dhaka triggered international outrage.

Police said they had arrested two suspects at the scene and retrieved three knives, but a third escaped.

Deputy commissioner Wahidul Islam said Rahman had been "brutally hacked to death".

"They hacked him in his head and neck with big knives and once he fell on the ground they then hacked his body," he said.

Rahman's blog did not appear to focus on religious issues, although fellow writers said he opposed religious fundamentalism.

Police said he used a Facebook page under the name Washiqur Babu to post articles written by other writers that appeared to mock fundamentalist Islamic views.

Deputy police commissioner Biplob Kumar Sarker told AFP the motive for the killing appeared to be "ideological" differences with fundamentalist groups in Bangladesh.

"So far what we've gathered after primary interrogation of the two suspects is that they killed him him because he criticised hardline Islamists," he said.

Officially secular Bangladesh has seen a rise in Islamism in recent years.

Fellow blogger Asif Mohiuddin, who survived a brutal attack by Islamists in January 2013, described Rahman as a "fellow warrior".

"He is a friend of mine and a fellow warrior. He was an atheist and a believer in humanism," said Mohiuddin in a Facebook message to AFP from Berlin.

- Call for protests -

The two suspects in custody are aged about 20 and are both students of madrassas or Islamic schools, Islam said.

The killing bears strong similarities to the murder of Avijit Roy, an American blogger of Bangladeshi origin who was hacked to death with machetes in Dhaka last month.

His death sparked uproar, with hundreds of secular activists holding protests for days to demand justice.

Story continues

Witnesses said Roy and wife were returning from a book fair when they were both hauled off their rickshaw on a busy street by at least two attackers who then slashed them with machetes.

Prime Minister Sheikh Hasina's secular government has faced criticism for failing to do enough to protect humanist writers.

Police have arrested one suspect over the death of Bangladesh-born Roy, who was also the author of a series of books including the controversial best-seller "The Virus of Faith".

Roy's murder followed the 2013 killing of atheist blogger Ahmed Rajib Haider.

A court this month ordered seven university students and a Muslim cleric to stand trial for his murder.

Fellow bloggers and secular writers reacted angrily to the latest attack, with secular activists calling for protests later Monday.

"He was murdered because we have a culture of impunity here. He was a progressive free thinker and was against religious fundamentalism," said Imran Sarker, head of a Bangladeshi bloggers' network.

"We condemn this attack and have urged all bloggers to join protests."

Sarker said Rahman blogged under the pseudonym Kutshit Hasher Chhana, which translates as Ugly Duckling.