DHAKA - A Bangladesh court upheld the death penalty for 139 soldiers on Monday over their role in a "brutal and barbaric" mutiny in which dozens of top army officers were massacred.

In delivering his verdict Justice Md Abu Zafor Siddique described the 2009 slaughter of 74 people - including 57 top brass - as an unprecedented atrocity in Bangladesh's relatively short history. "It was the most heinous, brutal and barbaric carnage of our history," he told the Dhaka courtroom of the two-day massacre in which victims were shot, hacked to death and burned alive by marauding troops.

The sentences will be appealed again in the Supreme Court, which by law has the final say in all capital punishment cases.

In 2013 a court sentenced 152 soldiers to death for the grisly killings in a mass trial criticised by the United Nations rights chief as failing to meet basic standards of due process.

One of those handed the death penalty died in custody, eight others had sentences commuted to life imprisonment and four were acquitted.

Thousands were rounded up and tried in special military courts in the aftermath of the massacre, as the newly-elected government of Prime Minister Sheikh Hasina wrestled to regain control in a country prone to military coups.

Hundreds were singled out for trial in civilian courts and handed punishments ranging from death to a few years. The high court in Dhaka on Monday upheld sentences of mixed severity to more than 380 accused, including 185 life sentences, prosecutor Jahid Sarwar Kazal told AFP. "Forty-five people were acquitted," he added.

The mutineers stole thousands of weapons in February 2009 from the headquarters of the Bangladesh Rifles (BDR) paramilitary squad before embarking on a killing spree in the barracks.

The home of the BDR chief was also stormed and his wife, guests and staff slaughtered before the building was razed. The remains of those butchered in the carnage were dumped in sewers or shallow graves.

"Nowhere in the world did anything happen like the way those 57 top army officers were killed," Bangladesh Attorney General Mahbubey Alam told reporters outside the courthouse.

The uprising quickly spread to other military bases, with thousands of soldiers seizing weapons and pledging allegiance to the mutineers in Dhaka before it was quashed by the army.

An official investigation into the mutiny blamed years of pent-up anger among ordinary soldiers , who felt their appeals for pay rises and better treatment were ignored. Rights groups criticised the scale of the punishments meted out en masse, claiming the trials were "an affront to international legal standards".

Bangladesh defended the death sentences, insisting those convicted would have a chance to appeal and denying claims that confessions were extracted through torture.