Bangladeshi authorities say a Canadian man suspected of organizing a deadly attack on a popular restaurant in Dhaka has been killed in a police raid near the capital.

The country's top counter-terrorism official says officers killed three suspected militants early Saturday, including Bangladeshi-born Canadian Tamim Chowdhury.

He had lived in Ontario with his family and completed a chemistry degree at the University of Windsor but left Canada in 2013 in a suspected attempt to travel to Syria.

Police inspect a two-storey house after Saturday's raid. (Associated Press)

Police accuse Chowdhury of being one of two masterminds behind the July attack on the Holey Artisan Bakery that left 20 people dead, 17 of them foreigners.

He's also suspected to have led a July 7 attack on a prayer gathering near Dhaka that left four people dead, including two police officers.

Police sharpshooters raided a two-story house in Narayanganj district near the capital, Dhaka, after receiving a tip that Chowdhury and others were hiding there, top counterterrorism official Monirul Islam said.

Police look inside the Holey Artisan restaurant after gunmen attacked patrons last month. (Adnan Abidi/Reuters)

Global Affairs Canada issued a statement Saturday saying it was "aware of news reports that Tamim Chowdhury was killed in Bangladesh."

"Canadian officials are in contact with Bangladeshi authorities to gather additional information," the statement said. "No further details can be provided at this time."

The militants belonged to the banned group Jumatul Mujahedeen Bangladesh, or JMB, Bangladesh's police chief A.K.M. Shahidul Hoque told reporters.

Police said they found guns, ammunition and meat cleavers in the apartment where the men were holed up. The men also set off explosions to destroy their computers and other evidence, said Sanwar Hossain, a senior police officer.

"We heard explosions inside the apartment and we understood that they were destroying evidence," Hossain said. "When we felt that they would not surrender, we made our final push and killed them."

When police forced their way into the apartment, they found two bodies near the main door, and Chowdhury's body was found in another room, Hossain said.

Bangladeshi police have been conducting raids across the country to hunt those behind the attacks.

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

After storming the building Saturday, a SWAT team made the final push and fatally shot the suspects after they failed to surrender. Haque said the team asked them to give themselves up but that they kept on firing.

The group Islamic State in Iraq and Syria claimed responsibility for the restaurant attack, but authorities have denied the claim, saying it was the act of the JMB and that ISIS has no presence in the Muslim-majority country.

University of Toronto student transferred to prison

The family of ​Tahmid Hasib Khan, a University of Toronto student who was detained in Bangladesh after surviving the restaurant attack, says he has been transferred to prison.

Khan's family has maintained the 22-year-old, who is a permanent resident of Canada, is innocent.

Tahmid Hasib Khan, a permanent resident of Canada, was at the Holey Artisan Bakery in Dhaka, Bangladesh, when it was attacked in July. (Facebook)

"We want the court to affirm what we know — which is that he is innocent," said Khan's older brother, Talha, who is a Canadian citizen. "We want to take him to a mental health professional as soon as possible because of the trauma that he's been through. But I don't think it's going to be any time soon."

Khan arrived in Dhaka on July 1 to celebrate Eid with his family, and planned to travel to Nepal to begin an internship with UNICEF the following week. He was with friends at the Holey Artisan Bakery when five armed gunmen attacked. ​