If you want to stay, maybe talk to the people involved, or not, and possibly your manager or his manager. But definitely go to HR, and take notes or make them later, in a notebook not owned by the company. And be prepared to be officially harrassed or fired. The notes may help the employment suit, or the application for unemployment.
Either way, start testing the waters, even to the point of an interview.
Caveat: I have no direct experience with this problem.