Police killed five members of the one family in the northwest of the country in a raid on suspected members of the outlawed Jamayetul Mujahideen Bangladesh (JMB) group. One fire officer died in the assault.
Bangladesh police on Thursday raided a suspected militant hideout in an operation that left five relatives and a fire officer dead, officials said.
Police shot dead five members of the same family, as they emerged from a house in the northwest of the country, senior police officer Sumit Chowdhury said.
One of the five stabbed a fire officer, who died of his injuries, while two others hurled grenades at police. Two police were also injured.
"We were surprised by the attack. Two of them threw grenades and another attacked a fire service officer with a sharp rod. He later died in hospital," said Chowdhury.
"Five extremists were killed in our shooting. They include a father, his wife and their two sons and a daughter," he said.
Police raided the house in Habashpur, Rajshahi district, following a tip-off that members of the outlawed Jamayetul Mujahideen Bangladesh (JMB) group were holed up there, Chowdhury said.
Police rescued a two-month-old baby and a seven-year-old boy, and believe one woman may still be inside the house.
"The firing has stopped. But we have not entered the compound yet," assistant superintendent of police Ekramul Haq said, adding bomb disposal officers have been called to the site.
It was not clear whether the sons and daughter were adults, but police said two young brothers were suspected to have been killed and that one was wearing a suicide vest.
Bangladesh authorities have blamed the JMB, which has claimed allegiance to Daesh, for deadly attacks against religious minorities including Hindus, Christians, Sufi and Shia Muslims, and foreigners in the Muslim-majority country.
These include an attack on a cafe in the capital Dhaka last July in which 22 people were killed, most of them foreigners.
Police have since launched a nationwide crackdown against militants, arresting scores of suspects.
They have killed more than 70 people since the cafe attack, including at least 11 in the past two weeks.
Analysts say militants pose a growing danger in Bangladesh, where a long-running political crisis has radicalised opponents of the government.
On Tuesday three men stormed a mosque with cleavers and attacked a cleric from the Ahmadi minority Muslim community. The cleric was critically wounded.
Daesh and Al Qaeda have claimed responsibilities for many of the assaults but the government has rejected the claims.