Officials around the world have made tributes after at least 28 people were killed in an attack at a restaurant in Bangladesh - reportedly because they failed to recite verses from the Koran.
The 10-hour hostage crisis that gripped the diplomatic zone in the capital Dhaka started on Friday and ended on Saturday morning with the death toll including six of the attackers. Here is everything we know so far.
Gunmen stormed the Holey Artisan Bakery in Dhaka's Gulshan area while dozens were dining out.
The gunmen, initially firing blanks and shouting "Allahu Akbar" (God is Great), ordered restaurant workers to switch off the lights, and they draped black cloths over closed-circuit cameras, according to a survivor who spoke with local TV channel ATN News.
Some customers and kitchen staff managed to escape by running to the rooftop or out the back door, but about 35 were trapped inside.
Victims included 20 hostages, mostly foreigners, and two Bangladeshi police officers.
The 20 hostages killed included nine Italians, seven Japanese, three Bangladeshis and one Indian, government sources said, as details of the bloodshed began trickling from other capitals worldwide. The White House confirmed on Saturday that a US citizen was among the hostages killed, but did not release any further identification.
Two Bangladeshi police officers also died from injuries sustained while exchanging gunfire with the attackers.
Witnesses say the attack was religiously motivated.
According to the father of a Bangladeshi businessman, who survived the attack along with his family, the fate of the hostages depended on whether they could prove themselves to be Muslims.
Rezaul Karim said: "The gunmen asked everyone inside to recite from the Koran," the Islamic holy book. "Those who recited were spared. The gunmen even gave them meals last night."
The others, he said, "were tortured".
While some hostages were rescued, many were wounded as troops used gunfire to take over.
In the end, paramilitary troops managed to rescue 13 hostages, including one Argentinian, two Sri Lankans and two Bangladeshis, according to Lieutenant Colonel Tuhin Mohammad Masud, commander of the Rapid Action Battalion that conducted the rescue operations.
Japan's government said one Japanese hostage was also rescued with a gunshot wound.
IS group claimed responsibility for the attack, saying it targeted the citizens of "Crusader countries".
A statement circulated on Friday by IS supporters on the Telegram messaging service warned that citizens of such countries would not be safe "as long as their warplanes kill Muslims".
The Amaq news agency, affiliated with IS, said that the fighters used "knives, cleavers, assault rifles and hand grenades" and "verified" the hostages identities, sparing the Muslims and killing the foreigners.
But the Bangladeshi government is reluctant to confirm who was responsible, denying IS presence in the country.
The government did not directly comment on the IS claim but has denied in the past that the extremist group has a presence in Bangladesh. Prime Minister Sheikh Hasina instead has accused her political enemies of orchestrating the violence in order to destabilise the nation - which the opposition denies.
The attack marks an escalation in militant violence that has hit the traditionally moderate Muslim-majority nation, with the extremists demanding the secular government revert to Islamic rule.
Authorities are continuing to investigate the attack to uncover a motive.
Rezaul Karim's son, Hasnat, and other survivors were questioned by detectives as scattered details of the siege emerged. Authorities were also interrogating one of the attackers captured by commandos in the dramatic morning rescue.
It was not immediately clear whether the attackers had a specific goal, and Bangladesh authorities would not say if they had made any demands.
Victims' families and officials from their home countries have made sombre statements about their losses.
A Roman Catholic priest in southern Italy, whose 33-year-old sister Simona Monti, a textile firm employee, was killed in the attack expressed hope that her death could contribute toward making a more just world.
In New Delhi, Foreign Minister Sushma Swaraj said she was "extremely pained to share that the terrorists have killed Tarushi, an Indian girl who was taken hostage in the terror attack in Dhaka."
Emory University in Oxford, Georgia, said two of its students were killed in the attack: Abinta Kabir, of Miami, Florida, who was visiting family and friends in Bangladesh, and Faraaz Hossain, of Dhaka, who had completed his second year on the Oxford campus.
"Anyone who believes in religion cannot do such an act," the Bangladeshi prime minister said. "They do not have any religion, their only religion is terrorism."
She announced two days of national mourning for the dead.
The attack, during the holy Muslim fasting period of Ramadan, is one of an escalating number of religious hate crimes.
The government has cracked down on domestic radical Islamists by making scores of arrests. It has blamed local terrorists and opposition political parties - especially the main opposition Bangladesh Nationalist Party and its Islamist ally Jamaat-e-Islami.
But the attacks have continued, with about two dozen atheist writers, publishers, members of religious minorities, social activists and foreign aid workers slain since 2013. Earlier on Friday, a Hindu temple worker was hacked to death by at least three assailants in south-west Bangladesh. IS and and al Qaida affiliates have claimed responsibility for many of those attacks.