DHAKA - A suspected Bangladeshi Islamist militant believed to have been shot dead in Dhaka during a gunfight with police actually committed suicide, a forensic doctor said Sunday.

Abdur Rahim, 35, allegedly had a key role in July's Dhaka cafe attack in which 22 people died, police said.

He was killed in the capital's Azimpur neighbourhood on Saturday evening as officers tried to bust a militant hideout.

"Abdur Rahim was killed due to excessive haemorrhage after he slit his own throat with (a) sharp weapon," forensic doctor Sohel Mahmud at Dhaka Medical College Hospital told AFP after submitting the autopsy report. Rahim was a deputy of Tamim Chowdhury, the leader of a faction of the banned Islamist militant outfit, Jamayetul Mujahideen Bangladesh (JMB).

Chowdhury, a Canadian citizen of Bangladesh origin, was shot dead during a gunfight with police last month.

Three suspected female members of the group were also found injured in the hideout and were later arrested.

"Rahim slit his throat and committed suicide when he realised he might get caught by police," national police chief Shahidul Hoque said.

"However, we also found bullet wounds on his body, but he was mainly killed due to the sharp weapon damage," Hoque told AFP.

Police earlier said Rahim planned the Gulshan cafe attack and hired the flat used by the militants before the assault.

The JMB has been blamed for a wave of attacks on foreigners and religious minorities in the last three years that has killed at least 80.

With the latest death, at least 28 Islamist extremists have been shot dead by Bangladesh security forces since the cafe assault in which mostly foreigners died.