Dhaka: Bangladesh police on Saturday killed Dhaka cafe attack 'mastermind' Canadian-Bangladeshi Tamim Ahmed Chowdhury and his two associates during an encounter at the militants' hideout near the national capital.

"The gunfight erupted this morning after police started raiding a building at Naraynganj's Pikeparha," Counter-terrorism Unit's Additional Deputy Commissioner Sanowar Hossain was quoted as saying by the bdnews24.com.

The unit's chief Monirul Islam earlier said the raid was conducted upon information gleaned from an arrested operative of the banned Jama'atul Mujahideen Bangladesh (JMB).

Chowdhury was identified by police as the mastermind of the July 1 cafe attack in Dhaka that killed 22 people, including an Indian girl, and two police officers, and the subsequent assault on the Eid congregation at Sholakia.

According to police, Chowdhury used to stay in Canada and might have developed a network of financiers abroad before coming to Bangladesh in 2013.

Police had announced Tk 2 million reward earlier this month for information leading to Chowdhury's arrest.

ISIS had claimed responsibility for the cafe attack.