Six gunmen were killed during the police operation and one was captured alive, Bangladesh Prime Minister Sheikh Hasina said in a TV broadcast. She said 13 hostages were rescued, but that police were unable to save all of them.

"The operation is over and the situation is under control," army spokesman Colonel Rashidul Hasan told Reuters. The attack marks a major escalation in a campaign by Islamic militants over the past 18 months that had targeted mostly individuals advocating a secular or liberal approach in mostly Muslim Bangladesh.

The number and nationality of the hostages were unclear. Police said earlier the gunmen were holding about 20 hostages. One Japanese man was among those rescued and taken to a Dhaka hospital with a gunshot wound, a Japanese government spokesman said. Italy's ambassador to Bangladesh, Mario Palma, told Italian state TV seven Italians were among the hostages.

Islamic State, which has claimed the attacks, posted photos of what it said were dead foreigners killed in the assault. Police said they believed about eight to nine gunmen had been holed up in the cafe, armed with assault rifles and grenades.

Gowher Rizvi, an adviser to Bangladesh Prime Minister Sheikh Hasina, told reporters security forces had tried to negotiate with the gunmen.

The hostage crisis began when security guards in the Gulshan district of Dhaka, popular with expatriates, noticed several gunmen outside a medical centre, Rizvi said. When the guards approached, the gunmen ran into the Holey Artisan cafe, which was packed with people waiting for tables, he said.

The Police said the assailants exchanged sporadic gunfire with police outside for several hours after the gunmen attacked the restaurant around 9 pm on Friday.

A police officer at the scene said that when security forces tried to enter the premises at the beginning of the siege they were met with a hail of bullets and grenades that killed at least two of them.

Television footage showed a number of police being led away from the site with blood on their faces and clothes. Islamic State said 24 people had died. Bangladesh police denied that, saying the two police officers were killed and at least 20 people wounded.

Latest News from World News Desk