Those who passed were allowed to eat. Those who failed were tortured and slain.
The dramatic, 10-hour hostage crisis that gripped Bangladesh's diplomatic zone ended with at least 28 dead, including six of the attackers.
Commandos raided the popular restaurant where heavily armed attackers were holding dozens of foreigners and Bangladeshis prisoner while hurling bombs and engaging in a gunbattle with security forces.
The victims included 20 hostages, mostly foreigners, and two Bangladeshi police officers.
The attack marks an escalation in militant violence that has hit the traditionally moderate Muslim-majority nation, with the extremists demanding the secular Government set up Islamic rule. Most previous attacks have involved machete-wielding men singling out individual activists, foreigners and religious minorities.
The gunmen ordered restaurant workers to switch off the lights, and they draped black cloths over closed-circuit cameras, according to a survivor, who spoke to local TV channel ATN News. He and others, including kitchen staff, managed to escape by running to the rooftop or out the back door.
But about 35 were trapped inside, their fate depending on whether they could prove themselves to be Muslims, according to the father of a Bangladeshi businessman who was rescued with his family. "The gunmen asked everyone inside to recite from the Koran," said Rezaul Karim, describing what his son, Hasnat, had witnessed. "Those who recited were spared." The others, "were tortured".
Detectives were questioning his son and his family with other survivors as part of the investigation, as scattered details of the siege emerged. Authorities were also interrogating one of the attackers captured by commandos in the dramatic rescue.Bangladesh authorities would not say if they had made any demands. Isis (Islamic State) claimed responsibility, saying it targeted the citizens of "Crusader countries" in the attack.
The 20 hostages killed by the militants included nine Italians, seven Japanese, three Bangladeshis and one Indian. Ten of the 26 people who were wounded when the militants opened fire were in critical condition. Most of them were police officers, but one was a civilian.Two chefs working in the kitchen, Argentine Diego Rossini and Italian Jacopo Bioni, described how they made a dramatic escape during the initial attack by rushing to the rooftop terrace and then jumping down two storeys onto a nearby building as the attackers chased them, firing their weapons and hurling grenades.
"They were very well prepared with bombs, guns, machine guns, it was horrible", Rossini told Argentine TV newscast C5N. "They pointed with their guns to me and I could hear shots passing by. I was very, very afraid, like never before in my whole life ... It was one of the worst moments of my life."
Another Italian, businessman Gianni Boschetti, was dining with his wife but had just stepped into the restaurant garden to take a phone call when the attack began. Italian state TV said Boschetti threw himself into bushes and escaped. His sister-in-law, Patrizia D'Antona, said that he "wandered all night" from hospital to hospital in hopes of finding his wife, 56-year-old Claudia Maria D'Antona. She was later identified as among the nine Italians found slain.
In the end, paramilitary troops managed to rescue 13 hostages, including one Argentine, two Sri Lankans and two Bangladeshis, according to Lieutenant Colonel Tuhin Mohammad Masud, commander of the Rapid Action Battalion. Japan's Government said one Japanese hostage was also rescued with a gunshot wound. The commandos went in after the attackers did not respond to calls for negotiation, Masud said.

