Updated

A Baltimore middle school teacher has lost her job after using a racial slur while berating her students this week.

The unidentified science teacher, who is white, was caught on video disciplining a student, then telling the mostly black class that they "were going to be a bunch of broke-a-- n------ who get shot." She also called them "idiots" and "stupid."

The video was published on social media Thursday by New York Daily News reporter Shaun King.

Baltimore City Public Schools spokeswoman Edie House Foster said the incident occurred Tuesday at Harlem Park Elementary/Middle School.

Schools CEO Sonja Santelises said at a news conference Thursday that "The behavior in that video was not about a teacher trying to regain control of the class."

WARNING: Contains graphic language

The Baltimore Teachers Union said in a statement that it condemns the language the teacher used.

"The Union stands together with Baltimore City Public Schools in supporting respectful and equitable learning environments for all our students," the statement said.

The Associated Press contributed to this report.