Bangladeshi police stormed a restaurant in the capital Dhaka and rescued up to 10 hostages on Saturday, one official said, after an attack claimed by Islamic state.
Gunmen attacked the upscale cafe in the diplomatic area of Dhaka late on Friday and had been holding about 20 hostages, including foreigners, before police poured into the building to try to free those stuck inside. At least two police were killed.
A police officer at the scene said that when security forces tried to enter the premises at the beginning of the siege they met a hail of bullets and grenades.
Television footage showed a number of police being led away from the site with blood on their faces and clothes. Heavily armed officers were seen milling on the street outside.
The number of hostages still in the restaurant was unclear, Mizanur Rahman Bhuiyan, a deputy director at the Rapid Action Battalion force, told Reuters.
Bhuiyan told Reuters one foreigner, probably Japanese, was among those who escaped after more than 100 commandos launched an operation to secure the restaurant.
Islamic State, which has claimed the attacks, posted photos of what it said were dead foreigners killed in the assault on the cafe, where police believe eight to nine gunmen are holed up and armed with assault rifles and grenades.
Gowher Rizvi, an adviser to Bangladesh Prime Minister Sheikh Hasina, told Reuters that security forces had tried to negotiate a way out of the crisis.
Police said the gunmen attacked the Holey Artisan restaurant in the Gulshan district of Dhaka, popular with expatriates, in an assault that began around 9 p.m local time on Friday. The assailants exchanged sporadic gunfire with police outside for several hours after the attack.
An ambulance is seen after police stormed the Holey Artisan restaurant to rescue hostages, after gunmen attacked it and took hostages early on Saturday, in Dhaka, Bangladesh in this still frame taken from video July 2, 2016.
Islamic State said 24 people had died. Bangladesh police denied that, saying two police officers had been killed and at least 20 people wounded.
Italian and Indian nationals were among the hostages, said a duty officer at Rapid Action Battalion's (RAB) control room.
Italy's ambassador to Bangladesh, Mario Palma, told Italian state TV seven Italians were among the hostages. A Japanese government spokesman, quoting Dhaka police, said 12 people had been rescued but it was not known if any Japanese were among them.
Spate of murders
The hostage crisis marks an escalation from a recent spate of murders claimed by Islamic State and al Qaeda on liberals, gays, foreigners and religious minorities, and could deal a major blow to the country's vital $25 billion garment sector.
The restaurant assault also comes after Bangladesh hanged an Islamist party leader, Motiur Rahman Nizami, on May 11 for genocide and other crimes committed during a 1971 war of independence from Pakistan. That has drawn an angry reaction and some scattered violence from supporters. Nizami, 73, was a former legislator and minister during opposition leader Khaleda Zia's last term as prime minister.
Last year, several Western retailers temporarily halted visits to Dhaka following the killing of two foreigners.
Earlier on Friday, a Hindu priest was hacked to death at a temple in Jhinaidah district, 300 kms (188 miles) southwest of Dhaka.
Both Islamic State and al Qaeda have claimed responsibility for many of the killings, although local authorities say no operational links exist between Bangladeshi militants and international jihadi networks.
A prison van is seen along a street as police stormed the Holey Artisan restaurant after gunmen attacked it and took hostages early on Saturday in Dhaka, Bangladesh in this still frame taken from video July 2, 2016.
Bangladesh security officials say two local militant groups, Ansar-al-Islam and Jamaat-ul-Mujahideen, are behind the violence. Ansar pledges allegiance to al Qaeda, while Jamaat-ul-Mujahideen claims it represents Islamic State.
"The bottom line is Bangladesh has plenty of local, often unaffiliated, militants and radicals happy to stage attacks in ISIS's name," said Michael Kugelman, South Asia associate at The Wilson Centre in Washington D.C., using an acronym commonly used for Islamic State.
Islamic State had claimed more attacks in Bangladesh than in Pakistan or Afghanistan, he said.
Rizvi, the Bangladesh prime minister's adviser, said the hostage crisis began when security guards in the diplomatic enclave noticed several gunmen outside a medical center.
When the guards approached, the gunmen ran into the restaurant, which was packed with people waiting for tables, he added.
An employee who escaped told local television about 20 customers were in the restaurant at the time, most of them foreigners. The restaurant has a seating capacity of around 25 people.
Some 15 to 20 staff were working at the restaurant at the time, the employee said.