(A candlelight vigil on the one year anniversary of the Holey Artisan Bakery attack on July 1, 2017.)[Getty/Kyodo]

DHAKA - A Bangladesh special tribunal on Wednesday sentenced seven militants to death for their roles in a July 2016 attack on a cafe in Dhaka that killed 22 people, including seven Japanese, after a year-long trial.

In delivering the judgement, Judge Md. Majibur Rahman of the Anti-Terrorism Special Tribunal ordered the convicts to be hanged until their death.

The tribunal acquitted another defendant charged over the attack, which also killed nine Italians, one Indian, one Bangladeshi-American and four Bangladeshis, including two policemen.

The eight had pleaded not guilty, with the defense claiming insufficient evidence. The prosecution had demanded the death penalty for all them.

The men were not at the scene when the attack and subsequent hostage situation unfolded at Holey Artisan Bakery in Dhaka's posh Gulshan residential area on July 1, 2016, but they were later implicated for their roles in the attack, such as planning, recruiting and supplying weapons.

Six of them confessed during investigations, but the defense argued that other than their confessions, the prosecution lacked evidence.

Investigative authorities say, in total, they identified 21 suspects in connection with the case.

Eight of them were eventually charged, while the remaining 13, including the five gunmen who perpetrated the attack, were either killed when police stormed the care or later in various anti-militancy drives in different parts of the country.

The Islamic State militant group claimed responsibility for the attack.

The eight militants were said to be members of the IS-inspired local militant group Jamaat-ul-Mujahideen Bangladesh, also known as Neo JMB.

According to the charge sheet, they carried out the attack to destabilize Bangladesh and wanted to put the government under pressure, make investors and foreign consultants leave the country and hurt the economy.

Earlier this year, Bangladesh Intelligence officials said Mohammad Saifullah Ozaki, 36, a naturalized Japanese citizen and former university lecturer accused of recruiting youths in connection with the attack, had surrendered during a military operation against Islamic State in Syria and was being held in jail at Iraqi Kurdistan.