Image copyright AP Image caption Residents gathered to watch as the raid unfolded in Narayanganj

Bangladeshi police say they have stormed a hideout near Dhaka and killed the suspected planner of a cafe attack last month that left 22 people dead.

"Tamim Chowdhury is dead," said senior police officer Sanwar Hossain, referring to the Bangladeshi-Canadian suspected mastermind.

Three other suspected militants were killed by police during the raid.

The cafe attack began on 1 July when the militants entered the Holey Artisan Bakery in Dhaka.

They held hostages for 12 hours before police stormed the cafe, rescuing 13, killing six gunmen and arresting another.

Media playback is unsupported on your device Media caption Dhaka cafe attack: "Foreigners were isolated and then singled out"

Twenty hostages and two police officers were killed in the attack, the worst in the country's history.

The so-called Islamic State claimed responsibility for the attack, but the government dismissed the group's claim, saying it was the work of domestic militants from a banned Islamist group, Jamayetul Mujahideen Bangladesh (JMB).

Image copyright Reuters Image caption Police patrol outside the Holey Artisan Bakery following last month's raid

"Tamim Chowdhury is dead," Mr Hossain said. "He is the... attack mastermind and the leader of JMB".

Police earlier engaged in an hour-long gun battle with extremists at Paikpara in Narayanganj, 25km (16 miles) south of Dhaka, he added.

Chowdhury returned to Bangladesh from Canada in 2013.