INDIANAPOLIS (AP) — The Indiana Supreme Court says students must be told about their right to remain silent when questioned by police in a custody-type setting at school.

The court ruled Wednesday in the case of a 13-year-old boy suspected of a bomb threat at an Indianapolis school. The court threw out the confession, saying the boy wasn’t advised of his rights while being interrogated by a vice principal in the presence of armed officers.

The court says students must be advised of their rights if they’re being questioned while police are present and they don’t feel free to leave a room.

Chief Justice Loretta Rush says Miranda doesn’t apply if school officials simply are questioning a student, unless they’re acting as agents of the police.

(Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)