Bangladeshi forces stormed an upscale Dhaka restaurant to end a hostage-taking by heavily armed militants early Saturday, killing six of the attackers and rescuing 13 captives including foreigners.

The military said 20 of the hostages had been killed during the 12-hour standoff.

About 35 people were taken hostage, including about 20 foreigners, when gunmen stormed the popular Holey Artisan Bakery in Dhaka's Gulshan area, a diplomatic zone, on Friday night during the Ramadan holy month. Two police officers were killed at the start of the attack.

Hosne Ara Karim, whose son and daughter-in-law were rescued from the restaurant, waits for them near the scene of the attack in Dhaka. (Associated Press)

The bodies of nine Italians have been identified among the dead. Others who died included two Japanese women and five Japanese men. A U.S. citizen and an Indian citizen were also killed.

Italian media have identified one of the victims as a 47-year-old manager from northeastern Italy who was married and the father of three-year-old twin girls. Reports say he was in Bangladesh for work.

Global Affairs Canada says it's "closely monitoring reports" in Dhaka and "endeavouring to determine if Canadian citizens have been affected."

Canadian may be leading ISIS in Bangladesh

Amarnath Amarasingam, a fellow at George Washington University's program researching extremism, told CBC News he is "fairly confident" that a Canadian man is part of the ISIS leadership in Bangladesh.

"About a year now I've been trying to find out more information about this guy named Tamim Chowdhury, who's from Windsor, Ont." Amarasingam said.

"Bangladesh sources and journalists have placed him as the leadership of ISIS in Bangladesh, so attacks like the one we saw yesterday... in theory could be organized and orchestrated by someone like him."

A Windsor, Ont., man is suspected of being one of the leaders of ISIS in Bangladesh, says terror expert Amarnath Amarasingam 3:24

Amarasingam notes very little is known about Chowdhury, but says he is originally from Bangladesh and lived in Windsor before returning there.

Amarasingam says he has interviewed many of Chowdhury's friends in Windsor and people in the city's Muslim community.

"I've been able to piece together details of his life," he says. "And I'm fairly confident it's the same person and that [Chowdhury] is the leadership."

Bangladesh Brig. Gen. Nayeem Ashfaq Chowdhury said six attackers were killed by the paramilitary troops who mounted the rescue operations. They also recovered explosive devices and sharp weapons from the scene. Chowdhury did not disclose the identities of the hostages.

Prime Minister Sheikh Hasina condemned the attack, which was claimed by the Islamic State group, and she said security officials arrested one of the militants.

Bangladeshi soldiers stormed the restaurant, which was popular with foreigners, after heavily armed militants attacked it and took several hostages. (Associated Press)

"Because of the effort of the joint force, the terrorists could not flee," Hasina said in a nationally televised speech, vowing to fight militant attacks in the country and urged people to come forward.

"Anyone who believes in religion cannot do such an act," Hasina said. "They do not have any religion, their only religion is terrorism."

Police patrol the area around the site of the attack in Gulshan, Dhaka's most affluent district and the city's diplomatic quarter. (Associated Press)

A Japanese government spokesman said a Japanese hostage was rescued with a gunshot wound but seven others are unaccounted for. Deputy Chief Cabinet Secretary Koichi Hagiuda said that the eight were together at the restaurant during the attack.

The rescued Japanese hostage has been identified as Tamaoki Watanabe, an employee with Almec Corp., a Tokyo consulting firm that specializes in construction projects.

Abinta Kabir, 18, one of the hostages who was killed, was a resident of Miami and an undergraduate student at Emory University's Oxford College in Atlanta. She was in Bangladesh visiting friends and family. (Abinta Kabir/Facebook)

Japanese broadcaster NHK reported that Almec is part of a Japanese development agency project to create an urban transportation system in Dhaka.

Two people from Bangladesh who were students at Emory University in Atlanta, Georgia, were confirmed by the school to have been killed. They were identified as Faraaz Hossain and Abinta Kabir.

Our thoughts and prayers go out on behalf of Faraaz and Abinta, their friends and family for strength and peace at this unspeakably sad time —@EmoryUniversity

The White House says a U.S. citizen was among the hostages killed.

Spokesman Josh Earnest confirmed the death Saturday. An identity has not been released.

Earnest says the U.S. government has offered assistance to Bangladeshi authorities as they investigate what happened.

Earnest says the attack was a "despicable act of terrorism" and the U.S. stands with Bangladesh and the international community to confront terrorism wherever it occurs.

Bangladeshi security personnel stand guard after gunmen stormed the restaurant. (STR/AFP/Getty Images)

Masud said that two Sri Lankans were among the hostages rescued. Others included an Argentine and two Bangladeshis, local media reported.

The Islamic State group claimed responsibility for the attack, according to the SITE Intelligence Group, which monitors jihadist activity online. The Amaq news agency, affiliated with ISIS, also posted photos purportedly showing hostages' bodies. The authenticity of the images could not be confirmed.

With the sound of gunfire and explosions, local TV stations reported that the rescue operation began at 7:40 a.m. It included army personnel with automatic weapons and at least seven armoured vehicles and ambulances. The attackers did not respond to authorities' calls for negotiation, Masud said.

The attack came during Ramadan, when people in the mostly Muslim country fast during the day and eat after dark.

It's believed at least nine attackers entered the restaurant on July 2. (Google maps)

On Friday evening, many people headed to the popular bakery and restaurant that serves Spanish food and is patronized by residents of Gulshan, an affluent neighbourhood where most of the foreign embassies are located. The restaurant overlooks a lake and on pleasant evenings, diners often chose to eat outdoors.

Kitchen staffer Sumon Reza, who escaped, said the attackers chanted "Allahu Akbar" (God is Great) as they launched the assault around 9:20 p.m. Friday, initially opening fire with blanks.

Rezaul Karim, the father of a Bangladeshi businessman who was rescued along with his family, said the attackers did not harm any hostage who could recite verses from the Islamic holy book, the Qur'an.

Patrons tortured for not reciting Qur'an

Karim said his son, Hasnat, had gone to the restaurant along with his wife and two children to celebrate the birthday of his elder daughter when the attack happened. "He told me, 'Please save us, please!' And he hung up," he said.

Karim said his son told him that the attackers "did not hit people who could recite verses from the Qur'an. The others were tortured," he said.

"The gunmen asked everyone inside to recite from the Qur'an. Those who recited were spared. The gunmen even gave them meals last night," Karim said.

He said detectives were questioning his son and his family as part of the investigation.

Many among 26 wounded in critical condition

Police said the two officers died at a hospital after being wounded in the initial gunfire. Ten of 26 people who were wounded when the militants opened fire were in critical condition, and six were on life support, according to hospital staff. The injuries ranged from broken bones to gunshot wounds. Only one civilian was among the wounded.

At least 13 people were rescued Saturday morning. (Mahmud Hossain Opu/Getty Images)

The attack marks an escalation in the militant violence that has hit the traditionally moderate Muslim-majority nation with increasing frequency in recent months. Most attacks have been by machete-wielding men singling out individual activists, foreigners and religious minorities.

The government did not directly comment on the ISIS claim but has denied that the extremist group based in Syria and Iraq has a presence in Bangladesh, instead blaming the recent violence on its political enemies.

A resident near the scene of the attack said he could hear sporadic gunfire nearly three hours after the attack began. (Associated Press)

The recent attacks in Bangladesh have raised fears that religious extremists are gaining a foothold in the country, despite its traditions of secularism and tolerance.

About two dozen atheist writers, publishers, members of religious minorities, social activists and foreign aid workers have been slain since 2013. On Friday, a Hindu temple worker was hacked to death by at least three assailants in southwest Bangladesh. ISIS and and al-Qaeda affiliates have claimed responsibility for many of the attacks.

Hasina's government has cracked down on domestic radical Islamists by making scores of arrests. It has accused local terrorists and opposition political parties — especially the main opposition Bangladesh Nationalist Party and its Islamist ally Jamaat-e-Islami — of orchestrating the violence in order to destabilize the nation, which both parties deny.

​