Six people were killed and nearly 40 others injured, including a top intelligence officer, in two powerful blasts outside a building occupied by Islamist militants as commandos prepared for a final assault to flush them out in Sylhet city in Bangladesh, police said today.

The first blast happened around 7:00 pm yesterday, about 400 metres off the five-storey building where the militants were holed up. It targeted the huge crowd witnessing the operation codenamed 'Twilight' and policemen deployed there.

Another blast took place in front of the hideout an hour later.

Six people, including two police officers, were killed in the attack. The other four victims were onlookers, two of them college students.

Source: b"Bangladesh security forces outside the militants' hideout / Source: Dhaka Tribune"

Hours later, the Islamic State claimed responsibility for the attack through its propaganda news agency 'Amaq'. The target of the attack was security forces, it said.

This was the third attack in Bangladesh in eight days for which the ISIS has claimed credit.

"A ban has been enforced barring entry of ordinary people within the vicinity of the building as final preparations were underway to flush the militants out from their den," a police officer told reporters.

Police had raided the building early morning Friday and cordoned off the area.

Source: b'Bangladesh security forces cordoning off the area in Sylhet / Source: Dhaka Tribune'

Counter-Terrorism and Transnational Crime (CTTC) chief Monirul Islam said they got information that JMB chief Musa along with some other JMB militants were in Sylhet, but it was not clear if they were the ones hiding in the building.

The neo-JMB, said to be inclined to the Islamic State, was behind the July 1 terror attack on a Dhaka cafe in which 22 people, including 17 foreigners, were killed.

TV channels were barred from broadcasting the operation "live" but their reports showed commandos taking taking positions around the building.

Eyewitnesses said sounds of intermittent gunshots and explosions were heard, indicating militants response to the security siege that continued for the last three days.

Source: b'Bangladesh police at the international airport in Dhaka / Source: Reuters'

Operation Twilight was launched after a suicide bomber on Friday night blew himself up at the international airport in Dhaka in an attack claimed by the ISIS. It came a week after an identical attack on an RAB camp in Dhaka.

Police had tracked down the Sylhet hideout less than a week after they busted two militant dens on the outskirts of the southeastern port city Chittagong.

Bangladesh has been witnessing a spate of attacks on secular activists, foreigners and religious minorities since 2013. The country launched a massive crackdown on militants specially after the Dhaka cafe attack.

(Feature image source: AFP)