We've seen some of the same type behaviors at about the same age. It was so frightening because we couldn't figure out why he was so unhappy with life. Well, I found out later what (we feel) caused most of it. We believe that ds was so stressed in his classroom due to the behaviors of another student. The other student would throw desks, hit himself, bang his head on the desk, scream at the teacher, just awful and disruptive behavior. DS told us that there were times when the teacher would motion for the kids to move out of the way because the other kid was getting wound up.
DS really liked school, liked his teacher(s), and said on more than one occasion that he wished this other kid would stop messing the whole class up. I believe that it was a stressful environment where ds no longer had the secure feeling he was accustomed to in school - not that ds could articulate all of that at the time. I think that he had all of this anxiety and no idea what to do with it, so it came out in these behaviors. I talked to the teacher and principal about it, but was less than thrilled with the principal's response.
Those are just my thoughts about what we experienced with my ds at the time. Once that school year was over, the behaviors lessened, although ds is still pretty intense emotionally. Later, we found out more of what ds's needs are and are definitely keeping an eye on things like depression and anxiety, which the psychologist mentioned could become an issue for ds due to 'giftedness'.
Good luck - I know how scary it is.