An anthropology professor at Princeton University allegedly used the n-word multiple times during a lecture this week, prompting several students to walk out as well as an expletive-laced in-class confrontation.

Several students told The Daily Princetonian that professor Lawrence Rosen used the word “n—-r” when asking a question Tuesday during his Anthropology 212 course, “Cultural Freedoms: Hate Speech, Blasphemy and Pornography.”

“What is worse, a white man punching a black man, or a white man calling a black man a n—-r?” Rosen allegedly said during a lecture on oppressive symbolism.

Student Devyn Holliday told the student newspaper that Rosen, who did not return a message seeking comment Friday, used the word while describing “what is acceptable as free speech and what is not.”

After asking that initial question, students said, Rosen used the word “n—-r” two more times during in-class discussions.

Holliday said there were about six black students in class at the time. They were left stunned by Rosen’s use of the word, according to Destiny Salter, another student in Rosen’s lecture.

“All the black students were looking at each other, as if asking whether he actually said that,” Salter told The Daily Princetonian.

Holliday said Rosen’s unexpected remarks prompted at least one white student to say he wasn’t “comfortable” with Rosen using the n-word in class. That led student Malachi Byrd to allegedly ask Rosen: “So are you just going to keep using the n-word?”

“Yes, if I think it’s necessary,” Rosen replied, according to Salter.

Byrd walked out of Rosen’s lecture at that point. He subsequently was joined by three additional students who left the class early, according to one student.

Byrd returned to class a short time later and allegedly confronted Rosen while using an expletive, an anonymous source told the student newspaper. A message seeking comment from Byrd was not returned on Friday.

Rosen, meanwhile, did not apologize and instead defended using the n-word, allegedly saying “it’s supposed to deliver a gut punch, so that’s why I used it.”

In each utterance, Rosen “used the word in its entirety,” Salter said.

“He said, ‘You need to suspend your disbelief for the sake of this class,’” Salter said.

After saying he didn’t think he needed to apologize, Rosen then turned the topic of the lecture to pornographic images. But before doing so, Rosen gave students the “option of whether you’d like to see them,” a courtesy he did not extend before using the explosive racial epithet, Holliday said.

At least two students filed a complaint with university officials after the lecture. Justine Levine, director of studies for Princeton’s Rockefeller College, told students in an email that she intended to work with students to resolve the matter, according to Salter.

Reached for comment Friday, Levine referred The Post to university spokesman Michael Hotchkiss, who said in a statement to The Post that the “values of free speech and inclusivity” are central to Princeton’s mission.

“The conversations and disagreements that took place in the seminar led by Professor Rosen on Tuesday afternoon are part of the vigorous engagement and robust debate that are central to what we do,” the statement read. “We will continue to look for ways to encourage discussions about free speech and inclusivity with the students in Professor Rosen’s class and the campus community more broadly. As part of those ongoing efforts, we are in the process of setting up a meeting with the students.”

Meanwhile, at least one faculty member is standing up for Rosen.

In a letter to the editor Thursday, anthropology department chair Carolyn Rouse said Rosen was trying to accomplish the goal of getting “students to move beyond their comment sense” to see how culture has shaped their beliefs.

“If our students leave our classes knowing exactly what they knew when they entered, then we didn’t do our jobs,” Rouse wrote. “Rosen has used the same example year after year. This is the first year he got the response he did from the students. This is diagnostic of the level of overt anti-black racism in the country today. Anti-American and anti-Semitic examples did not upset the students, but an example of racism did. This did not happen when Obama was president, when the example seemed less real and seemed to have less power.”