Two women were also among those killed in the blast at a five-storey building that was raided by the elite Rapid Action Battalion (RAB) early on Tuesday after a tip-off that a top Islamist extremist was holed up there.
"Seven bodies were found. They are all burnt," RAB spokesman Mufti Mahmud said, adding that the bodies were too damaged to be identified.
He said the hideout at Dhaka's Mirpur area belonged to Abdullah, a "daring Islamist extremist of JMB (Jamayetul Mujahideen Bangladesh)", the homegrown outfit blamed for a wave of deadly attacks in recent years.
"There was a explosion in his room. Seven people who were in the room died in the explosion," he said.
The RAB is tasked with tackling Islamist extremism in Muslim majority Bangladesh.
Officers cordoned off the building for nearly 24 hours and gave the alleged extremist the chance to surrender, they said.
The Bangladesh government blames the JMB for a series of attacks in recent years on foreigners, atheist bloggers, rights activists and religious minorities.
In the deadliest of these attacks, five gunmen stormed an upscale Dhaka cafe in July 2016, killing 22 people including 18 foreigners.
The ISIS terror group claimed responsibility for the attack.
But the police and the government blamed JMB for the carnage, discounting suggestions that ISIS had a foothold in Bangladesh.