Seven militants who killed 20 people at a restaurant in Dhaka were local Bangladeshis and authorities had tried before to arrest five of them, police said, as investigators probed for possible links with international Islamist extremist groups.
The gunmen stormed the upmarket restaurant in the diplomatic zone late on Friday, before killing non-Muslim hostages, including at least nine Italians, seven Japanese and an American.
Islamic State claimed responsibility, warning citizens of "crusader countries" that their citizens would not be safe "as long as their aircraft are killing Muslims", the group said in a statement. It also posted pictures of five fighters grinning in front of a black flag who it said were involved in the attack, according to the SITE monitoring website.
The claims have not been confirmed, but Bangladesh Home Minister Asaduzzaman Khan told Reuters late on Saturday that neither Islamic State nor al Qaeda was involved. He reiterated the government's line that home-grown militants were responsible for a spate of killings in the country over the past 18 months.
Students hold placard and candles as they pray to show solidarity with the victims of the attack on the Holey Artisan Bakery and the O'Kitchen Restaurant at Dhaka, Bangladesh, during a vigil in Agartala, India July 3, 2016.
"This was done by JMB," Khan said, referring to Jamaat-ul-Mujahideen Bangladesh, which claims to represent Islamic State in Bangladesh.
Nevertheless, deputy inspector general of police, Shahidur Rahman, told Reuters on Sunday authorities were investigating any connection between the attackers and trans-national groups such as Islamic State or al Qaeda.
He said the militants were mostly educated and from rich families, but declined to give any more details.
National police chief Shahidul Hoque said all the gunmen were Bangladeshi.
"Five of them were listed as militants and law enforcers made several drives to arrest them," Hoque told reporters in Dhaka late on Saturday.
Whoever was responsible, the attack marked a major escalation in violence by militants who have demanded Islamic rule in Bangladesh, whose 160 million people are mostly Muslim.Previous attacks have mostly singled out individuals advocating a secular or liberal lifestyle or religious minorities.
Reciting Koran verse
Friday night's attack, during the final days of the Muslim fasting month of Ramadan, was more coordinated than the previous assaults.
Gunmen singled out foreigners as soon as they stormed through the doors of the restaurant popular with expatriates. They ordered all Bangladeshis to stand up before the killing began, a source briefed on the investigation said. The Bangladeshis were later told to close their eyes and recite verses from the Koran and one militant cursed at a Bangladeshi for eating with non-Muslims during Ramadan, the source said.
Policemen move a barricade on the road leading to the Holey Artisan Bakery and the O'Kitchen Restaurant after gunmen attacked, in Dhaka, Bangladesh, July 3, 2016.
The Islamic State-affiliated Amaq news agency claimed in a report on Saturday the militants identified and released Muslim patrons from the Dhaka restaurant, SITE said.
The victims also included at least three Bangladeshis or people of Bangladeshi descent.
The militants hacked most of their victims with machetes, leaving their bodies to bleed over the floor.
A 12-hour standoff with security forces ended when around 100 commandos stormed the building, killing six of the militants and capturing a seventh after attempts at negotiations proved fruitless, authorities said. They recovered explosives and sharp weapons from the scene.
It was not clear if the attackers had made any demands.
Up until Friday's attack, authorities had maintained no operational links exist between Bangladeshi militants and international jihadi networks. Bangladesh has blamed JMB and another home-grown outfit for the wave of grisly killings over the past year and a half.
One line of inquiry being pursued is whether the restaurant attackers received any guidance from Islamic State or al Qaeda, an official in Bangladesh's counter-terrorism wing said.
"Pictures (uploaded on Twitter) indicate they might have been encouraged by ISIS (Islamic Sate) activities abroad," said Muhammad Zamir, a former senior Bangladesh foreign ministry official. "But this does not show a direct link to ISIS. This is exactly what was done and disputed later in the case of the Orlando attack."
He was referring to the killing of 49 people last month by a man who pledged allegiance to Islamic State.
Friday's attack in Dhaka was the worst since 2005, when JMB set off a series of bombs throughout Bangladesh in the space of an hour killing at least 25 people, mostly judges, police and journalists.
A policeman searches a man on the road leading to the Holey Artisan Bakery and the O'Kitchen Restaurant after gunmen attacked, in Dhaka, Bangladesh, July 3, 2016.
The authorities executed six top JMB leaders in March 2007 and police have continued to hunt for group members, often detaining suspected militants following intelligence tips.
In February, Bangladesh police arrested three JMB members suspected of killing a Hindu priest.
Islamic state has claimed responsibility for a series of other attacks in Bangladesh in recent months. An Italian missionary was shot and wounded in the neck last November. Another Italian and a Japanese citizen were killed in attacks at the end of September and early October last year.
The seven Japanese killed were working on projects involving the Japan International Cooperation Agency, an overseas aid agency, Japan's Chief Cabinet Secretary Yoshihide Suga said on Saturday.
Six of them were in Dhaka to work on a metrorail project, Bangladesh's communication minister, Obaidul Quader, said.
Italian media said several of the Italians victims worked in Bangladesh's $26 billion garment sector, which accounts for 80 percent of its exports.
Prime Minister Sheikh Hasina announced two days of national mourning beginning on Sunday and said the country would stand up and fight the "terror threat".