A Bangladesh court handed death sentences to seven members of an Islamist militant group on Wednesday for their role in an attack on a cafe in 2016 that killed 22 people, mostly foreigners, in the South Asian nation's worst such incident.

"Charges against them were proved beyond any doubt. The court gave them the highest punishment," public prosecutor Golam Sarwar Khan told reporters after the verdict, amid tight security at the court in Dhaka.

One of the eight accused was acquitted.