A Florida teacher who told his students not to date African-Americans because “they’re not worth it” has been suspended and will no longer work in the classroom — but not fired, according to reports.

David Swinyar’s offensive comments were made to a student at Kernan Middle School in Jacksonville, where he teaches math, CNN reported.

“If your boyfriend says bad things to you and/or treats you wrong, that means he’s acting like a n—-r,” Swinyar told the kid on Oct. 6, 2017, according to student testimony in a school district investigative report. “You all should not be dating all these different African-American boys because they are not worth it.”

The 48-year-old was suspended for 10 days without pay for “unprofessional conduct,” according to a decision by the school board.

“He will be reassigned to an appropriate district position with no contact with students for the remainder of the year,” wrote Dr. Patricia Willis to school board members, according to First Coast News.

Of the school’s 1,285 students, 22 percent are African-American, Duval County school statistics show.

Students said Swinyar has used the n-word on other occasions, CNN said.

“If my daughter was dating someone who used the f-word, I wouldn’t have any respect for that n—–,” Swinyar told a student, according to the investigative report.

Swinyar denied using the slur when confronted by another student.

He also allegedly said in front of student, “If [my daughter] was dating someone and that ‘n’ said the f-word, I would beat him up.”

Students said he denied his crass statements.

“I would never say that, but if I did, I am sorry,” Swinyar allegedly told them.

Swinyar’s accused of other bad behavior in the classroom, including calling his students “dumb” and making female students “uncomfortable by staring at their breasts and other parts,” the Huffington Post said, citing the investigative report.

Students also told authorities that Swinyar said he attended an African-American church and mocked the preacher in class.

“When Mr. Swinyar gets mad, he becomes aggressive,” a student said in the investigative report. “He loves to talk about politics and Donald Trump.”