WASHINGTON (AP) -- The Supreme Court has ruled in favor of an Alabama inmate who complained that he didn't have an independent mental health expert to help him try to stave off a death sentence at his trial.

The justices divided 5-4 Monday in siding with inmate James McWilliams. He did not have his own expert when he was convicted of raping and killing a convenience store clerk in Tuscaloosa.

The justices had previously decided that poor defendants whose mental health might be a factor in the criminal charges they are facing have a right to an expert's evaluation.

Justice Stephen Breyer wrote for the court that McWilliams' mental health assistance "fell far short" of what the earlier case required.

The decision also could affect two Arkansas inmates on death row.