Media playback is unsupported on your device Media caption Dhaka cafe attack: "Foreigners were isolated and then singled out"

Twenty people, most of them foreigners, have been killed in an attack on a cafe in Bangladesh claimed by so-called Islamic State.

Gunmen stormed the Holey Artisan Bakery cafe in Dhaka late on Friday before troops entered almost 12 hours later.

Six attackers were also killed and one was arrested, officials said. Bangladeshi PM Sheikh Hasina has declared two days of national mourning.

Nine Italians, seven Japanese, one US citizen and an Indian also died.

Bangladesh Army Brig Gen Naim Asraf Chowdhury said the victims had been "brutally" attacked with sharp weapons.

Italy's Foreign Minister Paolo Gentiloni said one other Italian was still unaccounted for. Many of the Italians reportedly worked in the garment industry.

Japan said one of its nationals was among 13 people rescued. The seven that died were consultants for Japan's foreign aid agency and Prime Minister Shinzo Abe said they "were giving their all for the development of Bangladesh".

Two Sri Lankans were among those rescued.

Who are the victims?

Nine Italians named by the Italian foreign ministry as: Cristian Rossi; Marco Tondat; Nadia Benedetti; Adele Puglisi; Simona Monti; Claudia Maria D'Antona; Vincenzo D'Allestro; Maria Rivoli and Claudio Cappelli

Seven Japanese. Names not released

Three Bangladeshis named in national media as Faraaz Ayaaz Hossain and Abinta Kabir, both students at Emory University in the US, and Ishrat Akhond. It is believed Abinta Kabir could also be a US citizen

One Indian. Tarushi Jain, 18, who was a student at the University of California, Berkeley

More about the victims

IS later released pictures online of five men it says carried out the attack. The smiling militants are shown posing in front of a black IS flag.

The SITE Intelligence Group, which monitors jihadist networks, said the images identified the attackers by noms-de-guerre indicating they were Bangladeshi.

The siege began as diners gathered to break their fast during the Muslim holy month of Ramadan.

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, it said.

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

Media playback is unsupported on your device Media caption Troops raided the cafe 12 hours after the siege began, as Jill McGivering reports

Image copyright AP Image caption Relatives of some of those inside the cafe are gathering for updates

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

Sumon Reza, a supervisor at the cafe in the Gulshan district of Dhaka, managed to flee to the roof when the attackers burst in.

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

Tension is palpable: The BBC's Sanjoy Majumder at the scene

Street 79 in Dhaka's upmarket Gulshan area is remarkably quiet. The street is barricaded with scores of heavily armed police.

"Please sir, please move back," one police officer tells us, politely but firmly.

The tension in the air is palpable. As more media teams arrive, the officer loses his temper and screams at his men, telling them to make sure no-one crosses the barricade.

The Holey Artisan Bakery is known as a bustling cafe popular with expats and wealthy locals.

"There is an open-air terrace overlooking a lake," Dhaka Mayor Annisul Huq tells me.

"That's why it was so popular. It was so serene. I can't believe that this has happened to my Dhaka, I simply cannot."

He has cut short a trip to Moscow and is visibly shaken.

People mill around, talking in whispers. There is fear in the air, but also disbelief at the nature of the attack and the brutality of it - the selective targeting of foreigners and the manner in which they were killed.

The attack began when the armed men burst into the cafe at about 21:20 (15:20 GMT) on Friday and opened fire.

Media reports quoted witnesses as saying that they shouted "Allahu Akbar", meaning "God is great".

At least two police officers were killed in exchanges of fire and 30 police officers were injured.

A statement on IS's self-styled Amaq news agency said militants had attacked a restaurant "frequented by foreigners".

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