A court in Bangladesh's capital has sentenced to death six militants from banned Islamist groups for the killing of seven people during a bank robbery last year.

The court on Tuesday also sentenced three other militants from the two groups to prison terms ranging from three years to life. Two other suspects were acquitted.

Both of the groups — Jumataul Mujahedeen Bangladesh and Ansaruallah Bangla Team — are banned in Bangladesh.

The men had been charged with throwing bombs and attacking bank officials, customers and bystanders with sharp weapons during an April 2015 bank robbery in the Ashulia industrial zone, just outside Dhaka, Bangladesh's capital.

Public Prosecutor Khandker Abdul Mannan said the men could appeal the verdict to a higher court.