DHAKA (Reuters) - Bangladeshi security forces on Saturday killed 12 members of an Islamist militant group blamed for a deadly attack on a cafe in Dhaka in July, senior officials said.

Most of the militants were killed in a three-hour gun battle as security forces raided four hideouts on the outskirts of Dhaka, Home Minister Asaduzzaman Khan told reporters.

The dead were believed to be members of a new faction of Jamaat-ul-Mujahideen Bangladesh (JMB), known as New JMB, which has pledged allegiance to Islamic State, authorities said.

Seven militants were killed in one raid after police were tipped off that the JMB’s Dhaka unit chief and his associates were there.

“We requested them to surrender but they opened fire at our officers instead and also exploded grenades,” Khan said.

The dead included JMB’s Dhaka military commander, known as Akash, he said. “We are trying to find out his real identity,” Khan added.

Police said the banned group’s suspected financier, Abdur Rahman, died when he leapt from a fourth-storey window as he tried to escape. Three million taka ($38,000), a firearm, ammunition, explosives and a mobile phone jammer were found in his house.

Three police officers were wounded in the operations, which also netted a large amount of explosives, weapons and machetes.

The July 1 attack in Dhaka’s diplomatic quarter killed 22 people, mostly foreigners, and was claimed by Islamic State.

Bangladesh has been hit by a spate of killings of liberals and members of religious minorities in the past year. Al Qaeda and Islamic State have made competing claims over the attacks.

Police have killed more than three dozen suspected militants in shootouts since the cafe attack, including its presumed mastermind, Bangladesh-born Canadian citizen Tamim Ahmed Chowdhury.

The government has consistently denied the presence in the country of any transnational militant organization such as al Qaeda or Islamic State.

Police believe that New JMB was involved in organizing the cafe attack.

While authorities blame the violence on domestic militants, security experts say the scale and sophistication of the cafe attack suggested links to a transnational network.

The United States believes elements of Islamic State are connected to operatives in Bangladesh, U.S. Secretary of State John Kerry said during a visit to Dhaka in August.

The targeting of foreigners could hurt foreign investment in the poor South Asian economy, whose $28 billion garments export industry is the world’s second-largest.