* Noun: It most commonly functions as a noun, referring to a period of time when a student is kept at school after regular hours as a punishment.
* Example: "My teacher gave me detention for talking in class."
* Verb: It can also act as a verb, meaning to keep someone at school after hours as punishment.
* Example: "The principal detained the student for fighting."
* Adjective: Less commonly, it can be an adjective meaning "kept at school after hours as punishment."
* Example: "The detention room was empty except for a few students."
So, the part of speech depends on the context!