Bangladeshi security personnel after gunmen stormed a restaurant in Dhaka on July 1. (AFP/Getty Images)

Police in Bangladesh killed three suspected militants in a shootout Saturday morning, including the Canadian citizen considered to have been a key organizer of the deadly terrorist attack on a cafe last month.

Tamim Ahmed Chowdhury, 30, was among those killed during an exchange of gunfire in the Narayanganj neighborhood near the capital of Dhaka, according to Monirul Islam, chief of the counterterrorism unit.

Islam said police received a tip that a small group of militants had been sheltered in a residential building in the neighborhood and that they cordoned off the area just after midnight, with the two sides exchanging gunfire.

The suspects were killed by a special operations team at about 10 a.m., he said, and police found grenades, pistols and AK-22 assault rifles at the apartment.

Chowdhury, 30, was a naturalized Canadian citizen who graduated from the University of Windsor in 2011, officials said. He returned to Bangladesh in late 2013 from the United Arab Emirates.

Officials have said that Chowdhury helped the attackers with safe houses and weaponry, and accompanied them as they made their way to the upscale Dhaka cafe-bakery on the evening of July 1. Ultimately, militants killed at least 22 people, including several foreigners and two police officers, in the overnight siege.

Islam said Chowdhury’s slaying was a major milestone because he was responsible for radicalizing the youths involved in the cafe attack as well as others who attacked worshipers July 7 at an Eid celebration.

“This is a significant progress for our counterterrorism drive because Tamim was responsible for collecting finances and later distributing them, recruiting and radicalizing members of elite families,” Islam said.

Authorities said Chowdhury is a leader of Jamaat-ul-Mujahideen Bangladesh, a new branch of the domestic terrorism outfit that produced the cafe attackers and is affiliated with the Islamic State.

Since 2013, authorities say, more than 50 terrorist attacks have been carried out by extremists in Bangladesh, a Muslim-majority nation of 160 million people. Those include killings of secular bloggers and publishers by machete-wielding assailants as well as the slayings of several foreigners, gay rights activists and members of minority religious groups.

Although the Islamic State and al-Qaeda claimed responsibility for many of those attacks, officials in the country had long denied that global terrorist networks had carried out the carnage, blaming local militants.

After the sophisticated operation at the Holey Artisan Bakery, however, they have cast a wide net to search for dozens of missing Bangladeshi men who may have been radicalized overseas. Secretary of State John F. Kerry is set to travel to the country Monday to discuss cooperation on a variety of issues, including security.

Earlier this month, authorities in Dhaka had announced a $25,000 reward for Chowdhury as well as another man, Syed Mohammad Ziaul Haque, the leader of the local militant group that carried out machete-hacking deaths of bloggers and other intellectuals.

The safe house where Chowdhury was killed Saturday could potentially provide a “treasure trove” of information for investigators about his activities and plans, according to terrorism analyst Animesh Roul, executive director of the Society for the Study of Peace and Conflict in New Delhi.

More important, Chowdhury’s death provides a key window in a growing threat for Bangladesh: affluent members of the diaspora who were radicalized overseas returning home to Bangladesh to wage jihad in their home country. Roul said that Bangladesh is particularly vulnerable because of its large diaspora in such places as Britain and Canada.

Chowdhury was radicalized among other young men in Calgary and Ontario, Roul said. Nibras Islam, a student at a Malaysian university, was one of the Dhaka cafe attackers. Authorities in 2014 arrested a British citizen of Bangladeshi origin in Dhaka suspected of recruiting for the Islamic State.

“This should be a major concern for Bangladesh but has been unfortunately ignored by authorities for a long time,” Roul said.

Gowen reported from New Delhi.