Lt. Gen. Jay Silveria, superintendent of the academy and the prep school, warned students at an assembly Thursday he would not tolerate racism.

“If you can’t treat someone with dignity and respect, then get out,” he said.

He told them they should be outraged by the incident.

Silveria said he called the families of the five prep school students who were the objects of the slurs.

Racial slurs are illegal in the military and can bring charges of violating orders and conduct unbecoming an officer.

The preparatory school has a 10-month program for potential cadets who applied for the four-year academic and military program at the academy but were not accepted. The goal is to help them meet academy requirements.

The prep school usually accepts about 240 students. The academy itself has about 4,000 students.

Silveria took command at the school in August and has repeatedly told cadets and staff that his highest priority is ensuring a climate of dignity and respect.

The academy has struggled with sexual misconduct problems several times in recent years but few racial incidents have been made public.

About 29 percent of the academy’s cadets were minorities in 2015, according to the school’s website. Ten percent were Hispanic, 10 percent Asian and Pacific islander, 8 percent black and 1 percent Native American.