detain
To keep someone in a place so they cannot leave.
To detain someone means to hold them in a place and prevent them from leaving, usually because of official authority or legal reasons. When police detain a suspect, they keep that person from walking away while they investigate. A teacher might detain a student after class to discuss why homework wasn't turned in. Border officials detain travelers whose documents need extra checking.
Being detained is different from being arrested: detention is often temporary, while arrest means formal criminal charges. Schools use detention as a consequence where students must stay after school or miss recess. Immigration officials run detention centers where people wait while their cases are reviewed.
You might say someone was detained at the airport, meaning security or customs kept them longer than other passengers. If your friend is detained talking to the principal, they're being kept there and can't leave yet. The word suggests someone with authority is doing the holding, whether that's a police officer, a teacher, or an official. When you're detained, you're stuck waiting and unable to continue with your plans until whoever detained you decides you can go.