Dhaka - Heavily armed Bangladeshi commandos were early Saturday preparing to storm a Dhaka restaurant where suspected Islamist militants were holding dozens of people hostage after a deadly firefight with police, officials said.
The Islamic State group claimed responsibility for the attack Friday night on the Holey Artisan Bakery restaurant in the capital's upmarket Gulshan diplomatic quarter in which two police officers were killed.
Heavily armed army and navy commandos arrived at the scene as the security forces prepared to storm the two-storey compound to break the nine-hour siege, a security official said.
"It could happen within the next hour," he said.
Police chiefs, however, said they were still trying to establish contact with the attackers in a bid "to rescue everyone without any harm".
Police said the gunmen burst in shouting "Allahu Akbar" (God is the Greatest) as people were having dinner at around 9:20 pm (1520 GMT) and set off explosives.
Italy's ambassador Mario Palma told Italian state television seven Italians were among the hostages.
"There is no desire to negotiate," he said of the attackers. "It's a suicide mission." Some diners managed to escape including an Argentine chef and a Bangladeshi man who took refuge in an adjacent building, but police said there were still a number of people being held inside the restaurant hours after the assault.
"Some people are being held at gunpoint," said Monirul Islam, chief of the police Counter Terrorism and Transnational Crime Unit.
Some managed to speak to relatives by phone, reporting there were up to 40 people trapped inside, around half of them foreigners, the private Ekattur TV station said.
Another told relatives he feared they would be killed if police tried to storm the restaurant to end the siege.
"He is very nervous," the man's uncle, who had spoken to him by phone, told AFP.
"He urged the police not to storm the restaurant, saying the gunmen will kill them." The White House said US President Barack Obama had been briefed on the attack, a rare occurrence in an area of Dhaka considered relatively safe.
The restaurant's supervisor Sumon Reza who escaped by jumping from the roof told a local newspaper there were 20 foreigners being held hostage.
"I was in the roof. The whole building was shaking when they set off explosives," he said.
Bangladesh has been reeling from a wave of murders of foreigners, religious minorities and secular activists by suspected Islamist militants.
But those murders generally only involved a handful of assailants and the latest attack appears to have been on a much bigger scale and the first time that people were held hostage.
The IS-linked Aamaq news agency said the group was behind the attack and that "more than 20 people of different nationalities (were) killed".
Heavily armed police and paramilitary guards cordoned off the area after the gunfight broke out.
"Two police officers including the head of Banani police station were killed. It appeared they were hit by bullets and splinters from a grenade," deputy commissioner of Dhaka police Sheikh Nazmul Alam told AFP.
"Up to 20 police officers were injured. Seven-eight people have come out of the restaurant. But there are some people inside." The attack took place near the Nordic Club, where expatriates gather, and the Qatari, Italian and Egyptian embassies as Bangladesh observes the Muslim holy month of Ramadan.
French ambassador Sophie Aubert said the restaurant was "very popular" with diplomats and other foreigners in Dhaka.
"We're very concerned that there are some hostages inside," she told AFP.
It follows a series of killings targeting foreigners in Bangladesh that have been claimed by the Islamic State group.
Earlier Friday a Hindu temple worker was hacked to death in western Bangladesh.
Police also shot dead two Islamist students suspected in last month's murder of a Hindu priest and arrested a top Islamist militant who masterminded an attack on a Hindu lecturer last month.
The government and police blame homegrown militants for the killings, which they say are part of a plot to destabilise the country.
They have blamed the main opposition Bangladesh Nationalist Party (BNP) and its Islamist ally.
Last month authorities launched a nationwide crackdown on local jihadist groups, arresting more than 11,000 people, under pressure to act on the spate of killings.
But many rights groups allege the arrests were arbitrary or were a way to silence political opponents of the government.
Experts say a government crackdown on opponents, including a ban on the country's largest Islamist party following a protracted political crisis, has pushed many towards extremism.