Bangladesh police detained three people on Sunday over the gruesome murder of a Hindu tailor one day earlier, the latest deadly attack on minorities claimed by the Islamic State group.

A senior officer said the principal of an Islamic madrassa and two others were being held for questioning over the hacking to death of Nikhil Chandra Joarder outside his shop in Tangail town, northwest of Dhaka.

Police suspect the 50-year-old Joarder may have been targeted on Saturday for making derogatory remarks about the Prophet Muhammad four years ago, as Bangladesh reels from rising Islamist violence.

Tangail deputy police chief Aslam Khan said the three have been "taken into police custody for questioning" including a local leader of the country's largest Islamist party, Jamaat-e-Islami.

"The madrassa principal filed a complaint against the deceased in 2012 for making derogatory remarks against the Prophet Muhammad," Khan told AFP.

The attack comes after two gay activists were hacked to death last week, attacks claimed by a Bangladeshi branch of Al-Qaeda, while a liberal professor was also killed days earlier.

Suspected Islamists have murdered at least 30 members of religious minorities, secular bloggers and other liberal activists, foreigners and intellectuals in Bangladesh in the past three years.

The IS group claimed responsibility for the latest attack, carried out by three unknown men who arrived on a motorbike.

It claimed Joarder "was known for blaspheming the Prophet Muhammad," the IS-affiliated Amaq news agency said, citing a source, according to SITE Intelligence Group.

Home Minister Asaduzzaman Khan rejected the claim of responsibility on Saturday, repeating the government's stance that the jihadist group, along with Al-Qaeda, have no known presence in Bangladesh.

The secular government and the police have instead blamed local banned militant groups for the attacks.

Four years ago, Joarder was charged with hurting religious sentiments and he spent three weeks in jail, before the unknown complainant withdrew the case against him.

In February, suspected Islamists decapitated a top Hindu priest inside a temple complex in one of the country's northern districts, an attack also claimed by the IS group.

A long-running political crisis in officially secular Bangladesh has radicalised opponents of the government and analysts say Islamist extremists pose a growing danger.

Hindus, the country's largest religious minority, make up nearly 10% of Bangladesh's 160mn population of mainly Sunni Muslims.