Bangladeshi troops say they have cleared a cafe in the capital Dhaka, where gunmen on Friday took at least 20 hostages, including foreigners.
They say 13 hostages, including four foreigners, were rescued and six attackers shot dead. However, the fate of other captives remains unclear. Several of those held at the Holey Artisan Bakery cafe were believed to be Italian, and some may be Japanese.
The militant group Islamic State (IS) has said it carried out the attack.
Tuhin Mohammad Masud, a commander of the elite Rapid Action Battalion, said: "We have gunned down at least six terrorists and the main building is cleared but the operation is still going on."
Explosions and heavy gunfire were earlier heard, as the army and navy commandos stormed the cafe in the morning. They were backed by police and paramilitary Border Guards Bangladesh, officials told the BBC.
Armoured vehicles were also seen moving in the Gulshan neighbourhood.
The gunfire stopped after about an hour. The identity of the rescued hostages and the fate of other captives believed to have been in the cafe was not immediately known.
At least two police officers were killed in earlier exchanges of fire late on Friday, and 30 police officers were injured. Eight or nine armed men burst into the cafe in the diplomatic area of the city at about 21:20 (13:20 GMT) on Friday and opened fire.
A statement on the IS self-styled news agency Amaq said militants had attacked a restaurant "frequented by foreigners". It said that more than 20 people "of different nationalities" had been killed but this has not been confirmed.
This is probably the first time ever foreigners have been taken hostage in Bangladesh. Though there have been a number of killings focusing on academics, activists and members of religious minorities, attacks on foreigners are rare.
The timing is important. Bangladesh has been gearing up for the Muslim religious festival of Eid, and most people have started going to their homes in villages and towns across the country for a week-long holiday period.
The government has always denied the presence of the Islamic State militant group in Bangladesh. So far the militants have targeted individuals and sometimes security forces. But storming a cafe in a heavily guarded diplomatic district is unprecedented and a dramatic escalation in violence.
The government has been caught unaware, and the attack exposes a big hole in Bangladesh's intelligence gathering and security system.
The cafe is described as being popular with expatriates, diplomats and middle-class families. Media reports quoted witnesses as saying that "Allahu Akbar", meaning "God is greatest", was heard as the militants entered the cafe.