A blogger in Bangladesh has been hacked to death after receiving threats and warnings from religious extremists about his writings on secular issues.

Avijit Roy was killed by attackers wielding meat cleavers and machetes at Dhaka University. It happened on the 11th anniversary of the death of another writer in the same place.

A police spokesman said he died of bleeding from several gaping wounds after arriving at hospital. Also injured in the attack was Roy's wife.

Roy authored the blog "Mukto Mona" blog - which translates as "free mind". In the wake of his death the website was unavailable for a spell.

Protests are planned today (Friday) against the killing, reported local press. Roy had also has links with the United States. His father, who is a US citizen, revealed that he has received "threatening" messages from hard line Muslims.

Commentators like Roy traditionally stand accused of committing blasphemy under Islamic stricture. The kind of writing deemed unacceptable often is often to do with social change, women's rights and so on.

It is by no means an uncommon occurrence for authors of alleged blasphemy to be persecuted and even murdered in Bangladesh: an atheist writer was killed by militants in 2013 and protests against other writers followed, leading to a swathe of authors being arrested.

Imran H. Sarker, head of an association for Bangladeshi bloggers, told AFP. "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."

Paying tribute to Roy, a friend said that being an atheist made him into a target. "In Bangladesh the easiest target is an atheist. An atheist can be attacked and murdered," said blogger Pinaki Bhattacharya.