Image copyright AFP/Getty Images Image caption The raid on the cafe lasted about an hour on Saturday morning

Bangladeshi troops have cleared a cafe in the capital Dhaka where suspected Islamist gunmen took at least 20 hostages, including foreigners.

Prime Minister Sheikh Hasina said 13 hostages were freed and six attackers shot dead. One of the gunmen was arrested, she said.

Some of those who were held at the Holey Artisan Bakery cafe were believed to be Italian and Japanese.

The militant group Islamic State (IS) has said it carried out the attack.

The 12-hour siege began as diners were gathering to break their fast during the Muslim holy month of Ramadan.

"It was an extremely heinous act," Sheikh Hasina said in a televised statement. "What kind of Muslims are these people? They don't have any religion.

"My government is determined to root out terrorism and militancy from Bangladesh."

Japan's Deputy Chief Cabinet Secretary Koichi Hagiuda said one Japanese citizen was shot and wounded in the attack, and that seven others were in the cafe. Japan's government has not yet been able to contact them, he said.

Bangladesh's Daily Star newspaper said the gunmen tortured anyone who was unable to recite the Koran. They provided meals overnight for only the Bangladeshi captives, the Daily Star said.

Sumon Reza, a supervisor at the cafe, was in the restaurant when the attack began but managed to flee to the roof.

"The whole building was shaking when they set off explosives," he told media in Bangladesh. He later jumped off the roof and escaped.

Media playback is unsupported on your device Media caption A Dhaka resident captured the sound of gunshots during the raid

Image copyright AP Image caption There was a tense stand-off all night at the cafe

Explosions and heavy gunfire were heard earlier, as the army and navy commandos stormed the cafe. 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 were not immediately known.

At least two police officers were killed in exchanges of fire late on Friday, and 30 police officers were injured.

The attack began when eight or nine armed men burst into the cafe in the diplomatic area of the city at about 21:20 (15:20 GMT) on Friday and opened fire.

A statement on the IS's self-styled Amaq news agency 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.

Unprecedented and dramatic: Anbarasan Ethirajan, BBC South Asia analyst

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.

Seven Italian nationals are believed to have been in the cafe, the Italian ambassador in Dhaka, Mario Palma, was quoted as saying by Italian media.

Lt Col Tuhin Mohammad Masud, commander of the Rapid Action Battalion, told Associated Press the gunmen did not respond when asked to negotiate. It is unclear if they made any demands.

The attack comes after a spate of murders of secular bloggers, gay activists, academics and members of religious minorities, blamed on Islamist militants.

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 great", was heard as the militants entered the cafe.

Image copyright Photoshot Image caption A Dhaka hospital said about 30 police officers had been injured

Image copyright AP Image caption Passers-by helped to carry the injured away from the Holey Artisan Bakery

Are you in the area? Have you been affected? You can share your experience by emailing haveyoursay@bbc.co.uk.

Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways: