The Utah Supreme Court has ruled that, in order for juvenile suspects to plead guilty to crimes, they must first understand the nature of the crime and its elements.

The ruling stems from the case of a 15-year-old Utah girl who gave birth and then left the baby in a window of her family's Salt Lake County home in September 2002. Court documents said that the girl, identified as K.M., managed to hide her pregnancy from her parents.

Prosecutors say that after the birth, she left the baby naked in a window well and went to bed. The girl eventually was rushed to the hospital after her parents found her in bed bleeding. The baby's body was recovered later.

In court proceedings, there was controversy over the baby's death. While K.M. consistently maintained the baby was born dead, an autopsy indicated that the baby might have been born alive.

The girl was charged in juvenile court with child abuse homicide. In a plea deal offered by prosecutors, K.M. and her parents agreed that she would admit responsibility.

Through an attorney, K.M. later requested to take back her guilty plea, saying she did not fully understand what she was admitting. During oral arguments before the Utah Supreme Court last May, justices wondered if the girl ever was capable of understanding her rights and the nature of the charge, since she had a low IQ and evidence of mental retardation.

In a decision issued Tuesday, the Utah Supreme Court ruled that juveniles must have a clear understanding of what they are admitting. In this case, K.M. indicated after her plea that she didn't realize she was admitting to "abusing a little body."

"Due process requires that juveniles understand the nature and elements of the crime to which they are admitting before their admissions will be knowing and voluntary," the high court wrote. "Because the juvenile court did not take steps to ensure such an understanding in K.M., and because we find that K.M. did not obtain such an understanding, we find that her admission was not knowing and voluntary."

The case has been remanded back to the juvenile court for further hearings in line with the ruling.