Updated

Bangladeshi security forces stormed an Islamist terror hideout on Saturday, killing three militants, including the suspected mastermind of last month's deadly attack on a Dhaka cafe.

Moniru Islam, the head of the police counter-terrorism unit in Dhaka, told Reuters that Tamim Ahmed Chowdhury, a Bangladesh-born Canadian citizen, was among those killed in the raid on a two-story house in the Naraynganj district, on the outskirts of the capital.

Chowdhury, who returned to Bangladesh from Canada in 2013, was believed to be one of two masterminds of the July 1 attack on the Holey Artisan Bakery in Dhaka's diplomatic quarter, as well as a July 7 attack on an Eid congregation outside Dhaka marking the end of the holy Muslim month of Ramadan.

The cafe attack killed 20 hostages and two police officers. Thirteen other hostages were rescued after police stormed the cafe to end the 12-hour siege. Six of the gunmen who took part in the attack were killed by police, while a seventh was arrested.

ISIS claimed responsibility for the attack. However, Bangladeshi authorities said the attack was carried out by local Islamist groups and insisted that ISIS had no presence in the majority-Muslim country.

A.K.M. Shahidul Hoque, Bangladesh's police chief, told reporters Saturday that the militants belonged to the banned group Jumatul Mujahedeen Bangladesh, or JMB.

The police chief said security officials raided the house acting on a tip that Chowdhury, along with other suspects, was hiding in the building. The suspects opened fire at officials who retaliated, he said.

A SWAT unit made the final push and fatally shot the suspects after they failed to surrender. Haque said the team asked them to give themselves up but they went on firing.

The Associated Press contributed to this report.