Eighteen foreigners were among those killed in the 10-hour standoff at the Holey Artisan Bakery.

Bangladesh has arrested a suspected terrorist who supplied weapons and explosives for a 2016 siege that killed 22 hostages, a top police official said Sunday.

Eighteen foreigners were among those shot and hacked to death in the 10-hour standoff at the Holey Artisan Bakery, an upmarket cafe in Dhaka, before military commandos stormed the building and freed some two dozen other people.

Mamunur Rashid was a key "decision-maker" in Jamayetul Mujahideen Bangladesh (JMB), a banned homegrown terrorist outfit blamed for the attack.

The 30-year-old was arrested while travelling on a bus outside the capital Dhaka, said Mufti Mahmud Khan, a spokesman for the elite Rapid Action Battalion.

Rashid "supplied money, arms, ammunition and explosives for the attack," Khan told reporters.

"He hid in a neighbouring country and tried to reorganise the group. They were also planning to rescue their accomplices from custody."

A former computer operator and Islamic seminary student, Rashid also provided logistical support to terrorists involved in several deadly attacks on religious minorities in the country's north, Khan said.

A court in Dhaka last month put eight terrorists on trial over the cafe attack.

Khan said Rashid was one of the two men charged in absentia, while the other six were already in custody.

The Holey Artisan Bakery siege fuelled fears over violent terrorist groups in the Muslim-majority nation of 165 million people.

The government also launched a nationwide crackdown against terrorists immediately after the attack, killing nearly 100 alleged terrorists in gunfights including several top JMB leaders.

The attack marked a violent escalation from a spate of high-profile murders in the country since 2013, with terrorists targeting Bangladeshi atheist writers, rights activists, gays, foreigners and religious minorities.

Bangladesh last week banned the release of a film based on the cafe attack, saying it would tarnish the country's image.