Bangladesh began observing two days of national mourning today after 20 hostages were slaughtered at a restaurant packed with foreigners in a terrifying escalation of a campaign of attacks by Islamist extremists.
Prime Minister Sheikh Hasina decreed the mourning period as she vowed to drag Bangladesh back from the brink, warning of a concerted bid to turn one of the world's most populous nations into a failed state.
Amid mass condemnation of the killings in Dhaka, whose victims included 18 foreigners, the Islamic State group said it had targetted a gathering of "citizens of crusader states" on Friday night at a Western-style cafe.
The bodies of the 20 slain hostages were found amid pools of blood after commandos stormed the cafe to end the siege. Two policemen were also shot dead in a fierce gunbattle at its outset.
Six gunmen were shot dead by the commandos at the final stages of the siege at the Holey Artisan Bakery cafe but one of the hostage-takers was taken alive and was being interrogated by Bangladeshi intelligence.
Security officials said most of the victims were slaughtered with sharpened machete-style weapons.
Hasina's government has previously blamed a string of deadly attacks against religious minorities and foreigners on domestic opponents, but the latest will heighten fears that IS's reach is spreading.
"Islam is a religion of peace. Stop killing in the name of the religion," Hasina said in an impassioned televised address to the nation.
"Please stop tarnishing our noble religion. I implore you to come back to the rightful path and uphold the pride of Islam."
The 68-year-old premier said the people behind the attacks were trying to ruin Bangladesh, a mainly Muslim nation of 160 million people.
"By holding innocent civilians hostage at gunpoint, they want to turn our nation into a failed state," she said.
Flags were being flown at half-mast in government offices and at other sites across the country while funerals of the two Bangladeshi victims were expected to be held.
UN chief Ban Ki-moon was among those who expressed outrage, stressing "the need to intensify regional and international efforts to prevent and combat terrorism".
Agony in Italy
And there was agony in Italy whose government confirmed that nine of its nationals had been killed.
"The terrorists want to rip away the daily fabric of our lives," said Prime Minister Matteo Renzi.
"Our duty is to reply with even greater force, by affirming our values, the values of freedom of which we are proud, and which are stronger than hatred or terror."
Seven Japanese nationals were also killed in the attack and Prime Minister Shinzo Abe said he felt "profound anger that so many innocent people have lost their lives in the cruel and nefarious terrorism".
US officials said one American citizen was among those killed and the government in New Delhi confirmed that a 19-year-old Indian who was studying at the University of California, Berkeley, had died.
Witnesses recounted how a massive gunfight erupted on Saturday morning as more than 100 commandos launched the rescue operation, nearly 11 hours after the siege began at about 9.30 pm.
Thirteen hostages were rescued in total, some of whom were rushed to a military hospital.
The father of one of the survivors was told by his son how the hostage-takers separated the locals from foreigners.
The attack, by far the deadliest of a recent wave of killings claimed by IS or a local Al-Qaeda offshoot, was carried out in the upmarket Gulshan neighbourhood which is home to the country's elite and many embassies.
Last month authorities launched a crackdown on local jihadists, arresting more than 11,000, but critics allege the arrests were arbitrary or designed to silence political opponents.
Bangladesh's main Islamist party has been banned from contesting polls and most of its leaders have been arrested or else executed after recent trials over their role in the 1971 war of independence from Pakistan.