Terrell Maxwell, convicted of capital murder, will get a new sentencing trial.

Fernando Santander was shot to death while sitting in a van at his apartment complex in Austin

The state’s highest criminal court Wednesday ordered a new sentence for Terrell Maxwell, who is serving life in prison without the possibility of parole for shooting an Austin man in the head during a 2007 robbery.

Maxwell was 17 at the time of the shooting, and the Texas Court of Criminal Appeals ruled that his mandatory sentence of life without parole violated the U.S. Constitution’s prohibition on cruel and unusual punishment when applied to defendants who were under the age of 18 at the time of the crime.

Maxwell’s capital murder conviction wasn’t affected by the court’s 5-4 ruling.

Wednesday’s ruling affects at least 12, and as many as 17, inmates who were tried from 2005-09, when a quirk in Texas law led to automatic life terms without parole for capital murder defendants who were under age 18. Most of the inmates were from Harris and Dallas counties.

Maxwell, now 23, will be returned to Travis County Jail to face a new sentencing trial in the death of Fernando Santander, who was shot while sitting in a van in the parking lot of his apartment complex near Rundberg Lane.

The Travis County district attorney’s office is weighing its sentencing options as it prepares for the new trial, said Scott Taliaferro, director of the appellate division.

Defense lawyer Jon Evans said that Maxwell can choose to have his sentence imposed by a judge or a jury.

“He and I will have to discuss these matters, see what we can do,” Evans said. “This is something I’ve been raising for years now with regard to this young man, and someone finally listened to us.”

According to trial testimony, Maxwell and two men went to a North Austin apartment complex looking for somebody to rob. The two accomplices, Michael Jamerson and Rashad Dukes, testified that Maxwell shot Santander when the 31-year-old, startled to find a gun pointing at his cheek, quickly raised his hands in surrender, court records show.

Maxwell, Jamerson and Dukes were arrested about two months later after a jailhouse tipster reported that Dukes, while at the Travis County Correctional Complex on unrelated charges, told inmates he was involved in Santander’s death, arrest records show.

In its ruling Wednesday, the Texas court split on whether a 2012 U.S. Supreme Court ruling — Miller v. Alabama, which established that automatic no-parole life sentences for juveniles were unconstitutional — applied retroactively to defendants like Maxwell.

Writing for the Texas court’s majority, Judge Cathy Cochran said that Maxwell must be given the opportunity to argue in court that life without parole wasn’t an appropriate sentence.

According to the Miller ruling, Cochran wrote, life without parole cannot be imposed unless jurors consider “how children are different, and how those differences counsel against irrevocably sentencing them to a lifetime in prison.”

Two dissents — written by Judges Michael Keasler and Paul Womack, joined by Presiding Judge Sharon Keller and Judge Barbara Hervey — said the Miller ruling shouldn’t be applied retroactively.

The Miller ruling affected sentencing laws in 28 states that made life without parole mandatory for more than 2,000 juveniles convicted of murder in adult court.

In Texas, juries were allowed to choose between execution and life without parole for those convicted of capital murder beginning in 2005. But because capital punishment was unconstitutional for offenders younger than 18, a guilty verdict meant a mandatory life sentence without parole for teens tried as adults.

Four years later, the law was amended to allow life sentences, with the possibility of parole after 40 years, for juveniles under age 17.

The 2012 Miller ruling, however, overturned mandatory sentences for offenders under age 18. The Texas Legislature closed the final loophole last summer, allowing jurors to consider life with parole for 17-year-olds.

Appeals courts across the nation have differed on whether the Miller ruling applies retroactively to juvenile criminals serving life sentences.

Wednesday’s ruling answered that question for Texas. But, as Cochran noted in her opinion, the different rulings raise the possibility that the issue will be revisited by the U.S. Supreme Court so the Miller decision can be uniformly applied nationwide.