A special tribunal in Bangladesh's capital Dhaka has handed the death penalty to seven militants on Wednesday over a case of Holey Artisan Bakery cafe attack in capital Dhaka in 2016.

In a packed courtroom amid tight security measures, Judge Mojibur Rahman of Anti-Terrorism Special Tribunal handed down the verdict in presence of all the eight accused.

The court, however, acquitted one accused in the case as allegations brought against him were not proved.

Two of the convicts are seen wearing black caps with a symbol similar to that of the Islamic State (IS) at the court room and flashed the victory signs.

When asked how did they (the militants) wear the IS cap in the court room, Bangladeshi Law Minister Anisul Huq said he had called for an investigation into the matter.

He, however, expressed satisfaction with the verdict of the case and termed it as a model example of fast trial.

One of the defense lawyers, Md Delwar Hossain, expressed his dissatisfaction over the verdict.

Talking to the journalists, he said his clients would appeal with the higher court. According to the charge sheet filed against the convicts, they carried out the attack to destabilize Bangladesh and put the government under pressure to serve their vested interests.

In its observations, the court also said the attack was carried out to draw support and attention of the Islamic State.

Five gunmen stormed the Holey Artisan Bakery cafe in Dhaka's diplomatic area Gulshan on July 1, 2016. They then brutally killed the hostages with guns and machetes, and used the victims' phones to publish images of the bodies on social media.

Those killed in the attack include nine Italians, seven Japanese, two Bangladeshis, an Indian and a Bangladeshi-born U.S. citizen.

The gunmen also killed two Bangladeshi police officers in the early hours of the attack. About 12 hours after the attack, the Bangladeshi army stormed the restaurant, killing the five attackers.

The Islamic State of Iraq and the Levant (ISIL) claimed responsibility for the attack. But Bangladeshi authorities rejected the claim, saying members of a banned local militant outfit plotted the attack.

Since the cafe attack, Bangladeshi police have conducted series of large-scale operations against militants. Neo-JMB, an offshoot of banned militant outfit Jamaatul Mujahideen Bangladesh (JMB), is blamed for the attack.

Monirul Islam, chief of Bangladesh's Counter Terrorism and Transnational Crime (CTTC) unit, in July last year submitted the charge sheet against the accused in the case. He had earlier said the accused are the members of Neo-JMB.

Tamim Ahmed Chowdhury, a Bangladeshi-Canadian, and Sarwar Jahan, identified as Neo JMB chief who was killed during a raid on Oct. 8, 2016, have been blamed as the mastermind of the brutal attack. Chowdhury was also killed in a police raid on Aug. 27, 2016.

Since the cafe attack, Bangladeshi police have conducted series of large-scale operations against militants, in which dozens of militants were killed.