Malaysia's cabinet has agreed unanimously to do away with the mandatory death penalty for drug traffickers, a minister said on Monday, but the decision still has to be approved by parliament.

The cabinet agreed to amend the colonial-era Dangerous Drugs Act of 1952 to give courts a choice in sentencing, Azalina Othman Said, a minister in the prime minister's department, said in a written parliamentary response.

Capital punishment is mandatory in Malaysia for murder and drug trafficking, among other crimes.

A total of 651 Malaysians have been sentenced to death since 1992 - most of them for drug offences, Azalina said.

In March, human rights group Amnesty International ranked Malaysia tenth in the use of death penalty among the 23 countries that carried out capital punishment last year.

"While the announcement for changes to the mandatory death penalty in its limited form to drug trafficking is a welcome move, it must only be considered a first step towards total abolition," Shamini Darshni Kaliemuthu, executive director of Amnesty International Malaysia, said in a statement.

It was not immediately clear when the amended law would be put before parliament, but it is expected to be approved.