Police in Brandon took the rare step of charging a teen under the Criminal Code after swearing in a school.

The 17-year-old boy was screaming profanities inside Crocus Plains High School, in the western Manitoba city, on Monday.

Sgt. Michael Pelechaty said the school's resource officer took the boy into custody and he was formally charged with "causing a disturbance by swearing."

The Brandon School Division issued a statement Tuesday afternoon.

"Yesterday at Crocus Plains Regional Secondary School we had a student that was in distress. His behaviour necessitated calling the school resource officer, which we did. The school resource officer assessed the situation and took the student into custody and out of the school," said the statement. "This was a singular incident."

Pelechaty did say the boy was not intoxicated at the time of the incident.

The maximum penalty for causing a disturbance under the Criminal Code is a fine of $5,000 or six months in jail, or both.