A Wisconsin school security assistant will be rehired after he was terminated last week for repeating a racist slur while telling a student not to use it, union officials said, following days of public outcry and protests by students and teachers.

The security assistant, Marlon Anderson, was fired after he said the slur during an exchange with a student on Oct. 9 at West High School in Madison. The student directed the slur at Mr. Anderson and Mr. Anderson repeated it while trying to explain why the slur was offensive. Both Mr. Anderson and the student are black.

On Monday afternoon, officials at the school district called the union representing Mr. Anderson, Madison Teachers Inc., to say his firing would be rescinded and that he would be placed on paid leave, said Doug Keillor, executive director of the union. Mr. Keillor said that the district is working on a transition plan on “how best to reintroduce” Mr. Anderson to the school.

The school district’s reversal came on the same day that Gloria Reyes, the school board president of the Madison Metropolitan School District, released a statement saying that Mr. Anderson’s termination should be rescinded.