The Washington state Supreme Court struck down the death penalty on Thursday after declaring in a court ruling that capital punishment is "imposed in an arbitrary and racially biased manner."

This makes Washington the 20th state to get rid of the death penalty.

"The use of the death penalty is unequally applied — sometimes by where the crime took place, or the county of residence, or the available budgetary resources at any given point in time, or the race of the defendant," Chief Justice Mary Fairhurst said in the opinion.

She also wrote: "The death penalty, as administered in our state, fails to serve any legitimate penological goal; thus, it violates article I, section 14 of our state constitution."

In 2014, Gov. Jay Inslee declared a moratorium on the death penalty saying that it was clear to him that the use of capital punishment is inconsistent and unequal. “This is a hugely important moment in our pursuit for equal and fair application of justice," Inslee declared in a statement on the ruling Thursday.

The decision was for the case of Allen Eugene Gregory, who was convicted of the rape, robbery, and murder of Geneine Harshfield in 1996. The court was unanimous in its decision Thursday, and everyone on death row will now have their sentence converted to life imprisonment.

Amnesty International, which opposes the death penalty unconditionally, celebrated the ruling.

"This is tremendous news for all who fought to abolish the death penalty in Washington. Now that Washington has become the 20th state to end this cruel, inhuman, and degrading punishment, other states should follow suit," said Kristina Roth, senior program officer at Amnesty International USA.

The court did note a caveat in the opinion. “We leave open the possibility that the legislature may enact a ‘carefully drafted statute’ to impose capital punishment in this state, but it cannot create a system that offends constitutional rights," it said.

There is a global trend toward abolishing the death penalty with only four countries responsible for 84 percent of executions, according to 2017 data.

The U.S. had 23 executions in eight states in 2017. Texas had the most with a total of seven, which accounted for 30 percent of the national total.