Inspector General of Police (IGP) AKM Shahidul Hoque said one person had been detained following the operation.

“We initially suspect them to be JMB (Jamaa’tul Mujahideen Bangladesh) operatives,” he told reporters gathered at the site.

Police said the militants were occupying a fourth-floor flat in a six-storey building — most of its apartments rented out to bachelors.

Additional Police Commissioner Sheikh Maruf Hasan said preparations for the raid, jointly conducted by RAB and police, got under way after midnight.

The final storming, led by SWAT, started just before 6am, he said.

Hasan said they found nine bodies inside the apartment once the raid ended.

Police are yet to reveal the identities of those killed.

“Jihadi books, bombs and firearms have been found,” said the senior police officer.

Police said all the dead wore black clothes and that they had found a black flag as well.

“We have found unpacked black dresses and a black flag. A grenade and a pistol have been seized from the apartment,” said Additional Deputy Commissioner Sanowar Hossain of the counter-terrorism unit.

The five Gulshan cafe killers, too, had worn black clothes while posing for photographs in front of an Islamic State flag.

The photos were reportedly released by the Islamic State after the Jul 1 attack, which left 22 people dead.

Since the Gulshan attack, police have been conducting raids on suspected militant hideouts in the capital and elsewhere.

After an hour of the search operation in the Kalyanpur area that started around 12.30am, police presence was strengthened on the street where the building stands, said Mirpur police OC Bhuiyan Mahbub Hossain.

The militants, holed up inside, shouted ‘Allahu Akbar’ (God is great) and opened fire as the raiding team approached the building around 2am, he said.

One of the suspected militants, injured in the skirmish, has been taken to the Dhaka Medical College and Hospital (DMCH).

The injured man has been listed at the DMCH as 25-year-old ‘Hasan’, son of one Rezaul Karim from the northern district of Bogra.

IGP Hoque told the media that ‘grenades’ were lobbed at the police as they closed in.

The raiding team at once called for backup forces, he said. “Reinforcements arrived and sealed off the area. Later, the SWAT squad and a Bomb Disposal Unit did a recce.”

The Bangladesh Police chief said that the final push to enter the building — ‘Operation Storm 26’ — started at 5:51am.

“The militants came out of the apartment firing their way out in an attempt to escape. They wore black dresses, had turbans on their heads, and backpacks with them,” said Hoque.

He said the militants and the Gulshan cafe attackers belonged to the same group.

“We suspect them to be JMB activists, but they claim themselves to be part of the IS (Islamic State).

“We have found no IS links with them,” said the IGP.

Allama Iqbal Anik, a resident of the building raided on Tuesday, said that there were four flats on each floor, most being rented out to ‘bachelors’.

The family of the building-owner lived on the first floor, he said.

Police said that the suspected militants rented rooms in apartments on the fourth-floor. Seven of the bodies were found lying in the corridor and two others in separate rooms.

Heavy police deployment was seen in and around the building on Tuesday morning with no one being allowed to leave or enter.

Counter-terrorism unit officer Hossain told bdnews24.com that they were now looking for bombs and explosives that might be lying in the apartment.

Dhaka Metropolitan Police Commissioner Asaduzzaman Mia, who visited the scene, told the media they felt more explosives could be hidden there and that no one would be allowed to enter until the search was over.

He added details of the incident would be released later at a media briefing.