Iowa Gov. Terry Branstad on Monday commuted the mandatory life sentences of 38 convicted killers who committed their crimes as juveniles, a move aimed at ensuring they will spend decades in prison rather than be released earlier because of a U.S. Supreme Court decision.

The governor's action changes 38 sentences from life without the possibility of parole to life sentences that allow parole only after 60 years.

Branstad said he wanted to keep the inmates from being re-sentenced, possibly to far more lenient prison terms, in the wake of a Supreme Court decision that barred sentences of life without parole for juveniles.

"Justice is a balance, and these commutations ensure that justice is balanced with punishment for those vicious crimes and taking into account public safety," Branstad said.

The high court's May ruling was in line with previous decisions that juveniles couldn't automatically be punished the same way as adults without considering their age and other factors. It allowed individual judges to sentence juveniles to life in prison without parole in murder cases but ruled that state and federal laws couldn't automatically impose such a sentence.

Last week, the Iowa Court of Appeals vacated the life without parole sentences of two Iowa inmates who were convicted of murder for their roles in crimes convicted when they were 17. Thomas Bennett and two accomplices were convicted of fatally shooting a Des Moines man in 1998. Christine Lockheart and her boyfriend were convicted of stabbing to death a retired Davenport bus driver in 1985.

It wasn't immediately clear how Branstad's action would affect the cases of Bennett and Lockheart.

Iowa attorney Gordon Allen, who represents Lockheart and another inmate whose case will be affected, said he thinks Branstad's order violates the spirit of the Supreme Court ruling and isn't likely to withstand court scrutiny.

"I think it's certainly questionable," Allen said.

Part of the problem Allen sees with the commutations is that Iowa law doesn't include a sentence of life with a minimum of 60 years, so he said he's not sure where Branstad came up with the figure. But Allen said he hadn't seen any details of the commutation order, so he couldn't immediately say how it will affect Lockheart and another client, Yvette Louisell.

Iowa Attorney General Tom Miller said his office consulted with the governor about the legal issues related to the commutations. Miller said he supports the move, and his office will defend the commutations in court.

"The state needs to do all it can within the confines of the U.S. Supreme Court decision to help protect public safety," Miller said.

Roughly three dozen states allowed juveniles to be sentenced to life without parole before the U.S. Supreme Court ruling. Opponents of the sentences estimate that just more than 100 inmates were serving such sentences in Florida, California, Delaware, Iowa, Louisiana, Mississippi, Nebraska and South Carolina.

But Florida holds more than 70 percent of the juvenile defendants locked up indefinitely for crimes other than homicide.