The U.S. Supreme Court on Thursday sided with a death-row inmate in a ruling warning of the hazards of judicial bias, slamming Pennsylvania's former chief justice for not stepping aside in a murder case in which he earlier had served as a prosecutor.

The court's 5-3 decision gave Terrance Williams, convicted in the 1984 bludgeoning murder of a 56-year-old man in Philadelphia, a fresh chance to challenge his death sentence before the state's top court due to now-retired Judge Ronald Castille's actions.

"Where a judge has had an earlier significant, personal involvement as a prosecutor in a critical decision in the defendant's case, the risk of actual bias in the judicial proceeding rises to an unconstitutional level," Justice Anthony Kennedy wrote in the ruling.