Washington (CNN) -- Police should have considered a 13-year-old robbery suspect's age when he was questioned without his parents present, a divided Supreme Court ruled Thursday, concluding a child in such a situation would not have reasonably felt free to walk away from the interrogation.

The 5-4 decision dealt with whether the unnamed juvenile was entitled to be given a Miranda warning, telling him he need not answer questions.

"It is beyond dispute that children will often feel bound to submit to police questioning when an adult in the same circumstances would feel to free to leave," said Justice Sonia Sotomayor for the court. "Seeing no reason for police officers or courts to blind themselves to that commonsense reality, we hold that a child's age properly informs the Miranda custody analysis."

The case was one of several this term dealing with the extent of constitutional rights for minors.

"J.D.B." was a 13-year-old special-needs public school student in 2005. He was escorted from his seventh-grade class and taken to a conference room. There a Chapel Hill, North Carolina, police investigator -- along with an assistant principal, school resource officer and an intern -- asked the boy if he wanted to talk about some recent criminal activity in the area.

The African-American boy agreed to talk. The door was closed but not locked.

After first denying any involvement, J.D.B. admitted breaking into several neighborhood homes and stealing items, including a camera. After the confession, the police officer told the boy he did not have to answer further questions, but he continued talking and gave further incriminating statements. The adults testified the youngster never asked to cease the questioning or to leave the room.

When the 30- to 45-minute session ended, the boy was allowed to leave and catch his bus for home. Officers later that day obtained a search warrant of his house and found the stolen goods. He was again questioned.

At no time were the youth's legal guardian or parents notified, and Miranda rights were never administered.

Larceny and juvenile delinquency charges were filed, and courts subsequently allowed the confession to be admitted as evidence, concluding J.D.B. was not in custody and talked voluntarily.

The appeal focused on the school interrogation, since the high court has previously ruled underage students are subject to some restrictions on their movements in that setting.

The 1966 Supreme Court ruling in Miranda v. Arizona established clear guidelines to protect all criminal suspects from being compelled to give self-incriminating testimony. As seen on countless cop shows on TV, the warnings protect against police coercion, but also establish when a person is "in custody." Such factors as location and the length and nature of the interrogation all would be factors. Weighing that, courts must make an objective determination of "how a reasonable man in the suspect's position would have understood his situation" about agreeing to talk.

But this case came down to how the "reasonable man" objective standard could be applied to a 13-year-old boy.

The majority said age is another of many factors that must be considered.

"Officers and judges need no imaginative powers, knowledge of developmental psychology, training in cognitive science, or expertise in social and cultural anthropology to account for a child's age," Sotomayor wrote. "They simply need the common sense to know that a 7-year-old is not a 13-year-old and neither is an adult."

Sotomayor and the justices ordered the state court to take another look at whether the boy was in custody, and to decide that question by taking into account the "relevant circumstances" of the interrogation that Sotomayor articulated.

She was supported by Justices Anthony Kennedy, Ruth Bader Ginsburg, Stephen Breyer, and Elena Kagan.

In dissent, Justice Samuel Alito accused the majority of injecting "personal characteristics" and a "reality-based approach" to Miranda that will lead to that legal standard continually shifting.

"If Miranda's rigid, one-size-fits-all standards fail to account for the unique needs of juveniles, the response should be to rigorously apply the constitutional rule against coercion to ensure that the rights of minors are protected. There is no need to run Miranda off the rails," Alito wrote. "Bit by bit, Miranda will lose the clarity and ease of application that has long been viewed as one of its chief justifications."

He was backed by Chief Justice John Roberts and conservative colleagues Justice Antonin Scalia and Clarence Thomas.

The case is J.D.B. v. North Carolina (09-11121).

.