RALEIGH, N.C. (AP) — A survivor from El Salvador's civil war must be resentenced because North Carolina jurors who decided he should die for his wife's killing weren't told to consider evidence relating his conduct to his mental condition, the state Supreme Court ruled Friday.

The justices vacated the death sentence but let stand the 2014 first-degree murder and first-degree kidnapping convictions of Juan Carlos Rodriguez of Winston-Salem for the 2010 death of his wife, Maria. Her decapitated body was discovered three weeks after she was last seen alive.

The majority in the 5-2 decision determined that Superior Court Judge Stuart Albright failed during Rodriguez's sentencing hearing to direct jurors to examine that Rodriguez's mental limitations and past struggles impaired his ability to fully comprehend his conduct.

Associate Justice Sam Ervin IV, writing the majority opinion, pointed to evidence showing Rodriguez was malnourished and in extreme poverty amid constant violence as a child in war-torn El Salvador in the late 1970s and '80s. He suffered a mental disorder, according to expert witnesses and had a low IQ and mild intellectual disability.

Jurors had to make a binding recommendation to the judge to sentence Rodriguez to death or to life in prison without parole. Ervin wrote there's uncertainty whether the judge adding this information to the list of mitigating and aggravating circumstances would have changed a juror's mind.

Evidence of Rodriguez's "mental limitations and disturbed and overwrought thinking supports a rational inference that defendant's ability to fully comprehend the wrongfulness of his conduct and to conform his conduct to the requirements of the law was adversely affected" when the murder occurred, Ervin wrote.

In the dissenting opinion, Chief Justice Mark Martin wrote there was no evidence linking Rodriguez's "purported intellectual impairment, mental disorders, and marital strife to his homicidal conduct."

"The majority also ignores the evidence showing that defendant's actions were carefully premeditated and that he took many steps to conceal his identity as the perpetrator," which would have prevented jurors from finding the mitigating circumstance occurred, Martin wrote.

The couple had been estranged at the time of Maria Rodriguez's death. She had entered a domestic violence shelter a month before, writing that her husband had threatened to kill her. She was last seen alive at the couple's former apartment by her children, who told investigators she had been bloodied by their father. He tossed her body over his shoulder, put her in the vehicle and said he was taking her to the hospital, according to evidence. Her skull was recovered 2½ years after her decapitated body was found, 20 miles away.

Rodriguez's IQ was estimated several times at below 70, a threshold for significantly impaired intellectual functioning. But accused killers in North Carolina also must show significant inability to adapt to daily life and that their mental disabilities were evident before adulthood.

Rodriguez has been on North Carolina's death row while awaiting the appeal. While more than 140 people await execution, the state hasn't carried out capital punishment in more than a decade as various legal challenges have blocked it. Changes in state law have also dramatically lowered the number of murder cases in which local prosecutors seek the death penalty.