Lawmakers in Sierra Leone voted unanimously Friday to abolish the death penalty, a momentous step that made the West African country the 23rd on the continent to prohibit capital punishment.

The decision was one more step in a long-sought goal of civil society organizations and legal practitioners who see the death penalty as a vestige of Africa's oppressive colonial history.

"This is a horrible punishment, and we need to get rid of it," said Oluwatosin Popoola, a legal adviser at the rights group Amnesty International, a leading critic of capital punishment.

A vast majority of the 193 member states of the United Nations have either abolished the death penalty or do not practice it.

"It's a dream come true in terms of criminal justice, to actually remove such a heinous penalty," said Simitie Lavaly, a member of Sierra Leone's Human Rights Commission and a lawyer who has represented people on death row.

Kanteh Yumkella, a lawmaker and former presidential candidate, called the decision "momentous."

"I can tell you that we had to reflect on it quite a bit," he said. "We thought of the political use of the death penalty, which has dogged us."

He added: "We've had a history here where people have been charged with treason. Some have been hanged."

The vote in Sierra Leone came against the backdrop of a steady march in Africa to discard brutal laws imposed by past colonial masters. In April, Malawi ruled the death penalty unconstitutional. In May 2020, Chad did the same.

Nearly half of Africa's 54 independent countries have abolished the punishment, more than double the number from less than two decades ago.

The legislators in Sierra Leone on Friday replaced the death sentence with a maximum life sentence for certain crimes, including murder and treason. That means judges will have the power to consider mitigating factors, such as whether the defendant has a mental illness. They would have had no such flexibility if the lawmakers had voted instead to replace the death penalty with a mandatory life sentence.

The last time the death penalty was carried out in Sierra Leone was 1998, when at the apex of a devastating civil war, 24 soldiers were executed by firing squad for having participated in a coup the year before.

Still, convicts have languished for years on death row, where their rights are minimal and where they know that a new government could carry out the punishment without warning.

Dozens of death sentences in Sierra Leone have been handed down every year. As of the end of last year, at least 94 people remained on death row.

Sabrina Mahtani, co-founder and former executive director of AdvocAid, said Sierra Leone's decision to do away with capital punishment was remarkable especially because it is still recovering from the 1991-2002 civil war that was characterized by intolerance, atrocities and extreme violence. She said Sierra Leone had provided a model that more powerful countries like the United States should emulate.

"Here's a small country in West Africa that had a brutal civil war 20 years ago, and they've managed to abolish the death penalty," Mahtani said. "They would actually be an example for you, U.S., rather than it always being the other way around."

President Julius Maada Bio's government has worked on several reforms to the criminal justice system, including the repeal of a law frequently used to repress the media. In May, at a review of Sierra Leone's human rights record at the United Nations, the government announced it would abolish capital punishment as well.