The killer of three Minneapolis men who was a teenager when he committed the murders will become the first in Minnesota to successfully fight his rare mandatory ­sentence of life in prison without parole.

On Wednesday, Mahdi Hassan Ali, now 23, is expected to receive a new sentence for one of the killings that would make him eligible for parole after 30 years. But his original punishment for the two other victims was life with parole after 30 years — to be served consecutively, meaning that Ali would be older than 100 before his possible release.

Minnesota has eight juvenile killers like Ali in prison under its “heinous crimes” statute, which requires the mandatory life sentence. Through an unusual legal twist, Brian Flowers, who was 16 when he killed a mother and son, may be next with a chance for resentencing.

Following a landmark U.S. Supreme Court decision in 2012, sentences of mandatory life without parole for juveniles in Minnesota and 28 other states were ruled unconstitutional. The state Legislature most likely will hear a bill in this year’s session to abolish the remaining discretionary life-without-parole punishment for juveniles, a trend in many other states.

Ali was 16 when he killed an employee of Seward Market, the employee’s relative and a customer as they begged for their lives.

In Miller vs. Alabama, the Supreme Court ruled in a case involving a 14-year-old boy that sentencing juveniles to life in prison with no chance for parole without considering their youth, motive and potential for rehabilitation violated the Constitution’s ban on cruel and unusual punishment.

The Minnesota Supreme Court has ruled on two other mandatory juvenile life-sentence cases, both times rejecting arguments for changing sentences. Those cases were appealed long before the U.S. Supreme Court’s Miller decision. In 1996, 17-year-old Timothy Chambers stole a car and led police on a chase that ended when he slammed into a squad car, killing a Rice County sheriff’s deputy. In 2000, 17-year-old Tony Roman Nose raped a teen and stabbed her to death.

Perry Moriearty, a ­University of Minnesota law professor and co-director of the Child Advocacy and Juvenile Justice Clinic, and Bradford Colbert, a William Mitchell law professor, represented Flowers and Chambers.

The Ali case looms large in their effort for resentencing for Flowers, who has motions pending in Hennepin County District Court. Flowers and another teenager, Stafon Thompson, stabbed a woman more than 100 times as her 10-year-old son watched, then killed the boy by smashing a TV over his head. Both were convicted of first-degree murder.

In 2014, the state Supreme Court vacated Ali’s sentence of life without parole and remanded the case to district court. Hennepin County Chief Judge Peter Cahill, who handled the resentencing, essentially had the option to rule that Ali deserved his original sentence or to give him life with parole. Justices Alan Page and David Stras wrote opinions stressing that the court didn’t have the right to overrule a sentence required by the Legislature or to find the mandatory statute unconstitutional and order the district court to impose life with parole.

Moriearty said the Supreme Court’s ruling surprised several legal experts she talked to around the country. And Cahill’s decision gave Ali no meaningful opportunity for relief.

Rachelle Stratton, one of Ali’s public defenders, said Cahill denied their request for a hearing to consider mitigating circumstances. U.S. courts are beginning to shift and are now recognizing that children should be treated differently during sentencing proceedings due to their continuing brain development and potential for rehabilitation, she said.

The Miller opinion said that lower courts should give individualized consideration to children before sentencing them to life without parole, taking these factors into consideration, she said. Ali’s consecutive sentences are the equivalent of a life sentence without the possibility of parole, and he should be given a hearing before this type of sentence is imposed.

“We had been hopeful that this court would have followed the Supreme Court in Miller, and given us an opportunity to present evidence regarding Mahdi, adolescent brain development, adolescent intelligence and emotional capabilities so that an individualized consideration could be made regarding his sentencing,” Stratton said.