A prominent American blogger known for his writing against religious fundamentalism has been hacked to death by cleaver-wielding attackers in Bangladesh's capital.

The attack on Avijit Roy, a Bangladesh-born US citizen, took place when he and his wife Rafida Ahmed, who was seriously injured, were returning from a book fair at Dhaka University. Ms Ahmed is also a blogger.

It was not known who was behind the attack, but Mr Roy's family and friends say he was a prominent voice against religious fanatics and received threats in the past. No groups have claimed responsibility.

Local police chief Sirajul Islam said: "Several attackers took part and at least two assailants hit them directly." He said two blood-stained cleavers were found.

Mr Roy founded a popular Bengali-language blog, Mukto-mona - Free Mind - in which articles on scientific reasoning and religious extremism featured prominently.

Anujit Roy, his younger brother, said Mr Roy returned to the country earlier this month from the US and was planning to to back next month.

Similar attacks have taken place in Bangladesh, which is a Muslim-majority nation but ruled by secular laws. Investigators have blamed religious fanatics.

In 2013, another blogger, Ahmed Rajib Haider, who also spoke out against religious fanatics, was killed by unidentified assailants near his home in Dhaka. And in 2004, Humayun Azad, a prominent writer and a teacher of Dhaka University, was seriously injured in an attack when he was returning from the same book fair, an annual event.

Baki Billah, a friend of Mr Roy and also a blogger, told the Independent TV station that Mr Roy had been threatened earlier by people upset at his writing.

"He was a free thinker. He was a Hindu but he was not only a strong voice against Islamic fanatics but also equally against other religious fanatics," Mr Billah said.

"We are saddened. We don't know what the government will do to find the killers. We want justice."