"We found Tamim Chowdhury to be the mastermind of the two attacks… a manhunt was launched to track him down as we think he now lives in Bangladesh since his return [from Canada] three years ago," a police officer told PTI news agency on condition of anonymity.

Police found clues leading to Chowdhury after raids in Dhaka's Kalyanpur area earlier this week, in which nine militants were killed. Chowdhury's role in the attacks was revealed after officers interrogated 25-year-old Rakibul Hasan, a militant arrested in the Kalyanpur raid.

"He trained the extremists behind the two attacks and the nine extremists killed in Kalyanpur," an official told AFP news agency. He "used to visit the extremists' flat and give them necessary funds and encourage them by talking about jihad and religious issues," he added.

Chowdhury, a dual Canadian-Bangladeshi national in his early 30s, returned to Bangladesh from Canada three years ago.

He is suspected of leading a faction of the Jamayetul Mujahideen Bangladesh (JMB), a group blamed for the attack on Dhaka's upmarket Holey Artisan Bakery - a strike initially claimed by the self-styled "Islamic State" (IS).

A second attack took place six days later in Sholakia, in northern Bangladesh

Jihadi militants gunned down 22 people, including 17 foreigners, at Holey Artisan Bakery on July 1. Almost a week later, terrorists targeted Eid prayers in Sholakia in northern Bangladesh, killing two policemen and one woman. Seven terrorists were shot down immediately after the assault, according to official reports.

Dhaka police have repeatedly asserted that IS was not behind the attacks and are investigating whether Chowdhury's JMB faction had any ties with the militant group.

mg/cmk (AFP, PTI)