Some 400 prisoners on Uganda's death row have launched a legal challenge against capital punishment.
Many prisoners in East Africa face overcrowded conditions
Their lawyer told the constitutional court that hanging was a cruel and degrading punishment and so unlawful.
The AFP news agency reports that the five inmates representing their comrades in court shed tears as their lawyer graphically described a hanging.
The challenge is supported by the prisons department because hangings traumatise wardens, AFP reports.
The appeal by the 417 prisoners on death row is also being supported by Ugandan human rights groups.
No death sentences have been carried out in Uganda since 1999, when 28 people were executed in a single day.
A state lawyer argued that the death penalty should be maintained as it was an deterrent and was backed by most Ugandans.
"We represent all Ugandans who believe that people should be responsible for their mistakes," Benjamin Bagambe, told the court.