The young man expelled from Hermon High School for posting an offensive rap song on his MySpace page has, knowingly or unknowingly, kicked the hornet’s nest that is at the heart of American freedom of speech. The student, no doubt, has learned by now that free speech has its limits. Those limits have been well defined by the U.S. Supreme Court. Speech that threatens or endangers public safety or damages reputations without foundation is not protected, nor should it be.

But based on the evidence in public view, school officials have responded out of proportion to the offense, and have reached far beyond the campus boundaries to knock the young man off course by kicking him out of school permanently, perhaps affecting the rest of his life. There had to be a better way for the school to protect public safety.

The student did what many of his generation do. Instead of singing in front of a mirror using a hairbrush for a microphone, as his parents or grandparents may have, he recorded a version of Eminem’s “The Real Slim Shady,” substituting his own lyrics for the original rhymes. Those rhymes, admit-tedly, are consistent with the R-rated reputation of the idiom. Two school administrators are insulted in very personal, vulgar terms. And the most troubling lyrics suggest violence against some students. In the post-Columbine High School world, these words cannot be ignored.

The student clearly needed to be punished, but school administrators could have responded in a more measured and effective way.

If the parents or guardians shared school officials’ concern, half the battle would have been won. If the student also understood how inappropriate his rap song was, better still. If school officials were persuaded the student was not struggling to control violent impulses and not suffering from mental illness, a suitable resolution would have been at hand.

School administrators wisely consulted local law enforcement officials. An officer explaining to the young man that he could be charged with criminal threatening might have helped him see the light. This was what educators call a teachable moment.

Young adults like to try on attitudes and personas the way young children like to dress up in costumes. The teen nihilist or Marxist is not likely to embrace the dogma of those positions for the rest of his life.

And educators should know that a song — or novel, play or film — is not necessarily autobiographical. Holden Caulfield, the first-person narrator of “The Catcher in the Rye,” did not express the views of writer J.D. Salinger.

The student did not perform the rap in the cafeteria, e-mail the link to the song to administrators or distribute recorded versions to students. He posted it on his MySpace page, which is the 21st century version of bad-mouthing the principal to peers while hanging out at a local park on the weekend.

Expulsion could have lifelong ramifications. It should be reserved for something more dangerous than a rap song.