When Joseph Soares went to teach his social theory class at Wake Forest University this week, he walked past the armed police officer outside his classroom, unlocked the door, let his students in, then locked the door behind them.

Earlier this month, sociology classes were canceled outright after seven members of the department received offensive emails calling for a national purge of nonwhite people and included racist, anti-Semitic and anti-gay slurs. “We felt we were targeted,” said Soares, a professor who is chairman of the department. “I was disgusted, outraged and also fearful for my community.”

Five additional offensive emails were sent the next morning to the school’s department of Women’s, Gender, and Sexuality Studies, the Office of Diversity and Inclusion, the LGBTQ Center, and the Intercultural Center.

The messages have put some on campus on edge, arriving after a racially fraught spring semester at the private university in North Carolina. The sociology department has played a prominent role recently in anti-racist demonstrations on campus and in research into the sale of enslaved people that funded the school’s endowment. Soares said he thinks the department was singled out for that reason.

Several of the emails shared a common theme of extolling “the standards set by well raised white men.”

The email that was sent to Soares ended with, “We need to stop all diversity programs and restore what made the West the greatest force for true progress in the history of the world. I agree with the right on one thing, that we need to purge this country of the hyper-emotional, hyperbolic, and the hyper-pigmented.”

The members of Soares’s department who got emails “were singled out in a way that alarmed us greatly,” he said, because it suggested they might have been written by someone who had been in the building.

One of the emails was a racist attack sent to an administrative assistant, who is black and whose photo does not appear on the department’s website, he said. It seemed to Soares that “the only way this person knew to target her explicitly with the n-word and other racist things was to be aware of who she is."

There are two people who have stickers on their office doors announcing that their room is a safe space for gay, lesbian and transgender people, Soares said, and both of them got emails with anti-gay messages, including a slur as the subject line.

Maybe it was a coincidence, Soares said.

One faculty member moved classes to another building on campus, and another is teaching online, Soares said. Others have police officers stationed outside their classrooms.

A university spokeswoman said some sociology professors had canceled classes and others had not.

“Students have been really upset and scared,” said Mir Yarfitz, an associate professor of history. Some students immediately compared the language used in some of the emails to rhetoric from the August shooting in El Paso, when a gunman killed 22 people and wounded 24 others.

The students’ message was, “We’re not overreacting — this is a real threat. We don’t know how to deal with this situation,” he said.

Yarfitz was at an informal gathering of students who feel marginalized on campus who were talking about the emails and their fears that places they had considered safe — such as the Intercultural Center and the LGBTQ Center — could be targets for violence.

They were talking emotionally about how it feels to be a student here, he said, at a place that doesn’t always feel welcoming to all. “This makes them feel even more unsafe."

The emails arrived after a tumultuous spring semester. In February, after a photo of a person in blackface and another wearing a Ku Klux Klan robe was found on the medical-school yearbook page of Virginia Gov. Ralph Northam (D) generated national headlines, the university’s president, Nathan Hatch, addressed the campus about racist images and language in old copies of the Wake Forest school yearbook. Those included references to lynching, racial slurs, Confederate symbols and photos of students in blackface.

Hatch wrote that the university continues “to explore and improve how to reconcile our complex history with the progress we’ve made and the sense of belonging we want everyone in our community to feel.” Those efforts included researching the school’s historical ties to slavery.

Later that month, the university’s dean of admissions, Martha Allman, wrote a message to the campus apologizing for a photo in the 1982 yearbook in which she is posing with members of the Kappa Alpha Order fraternity around a giant Confederate flag. Another leader of the admissions office was also in photos with a Confederate flag. Hatch later announced that he had accepted Allman’s apology.

In March, members of the College of Arts and Sciences faculty voted overwhelmingly to condemn the university’s response to the discoveries, saying it was “delayed to the point of negligence,” and lacked measures to address the problems at the school. “These events are consistent with previous failures by university leaders to address anti-black racism and white-supremacy at Wake Forest with the urgency and transparency that they warrant.”

The faculty also voiced support for nine demands made by the Wake Forest University Anti-Racism Coalition, including zero tolerance for white supremacy; a dedicated space for black students to gather; a clear plan for retention and recruitment of black students, faculty and administrators; and transparency in bias reporting so that people would know how many incidents there were and what was done in response.

In April, people hung large banners calling for an end to white supremacy at Wake Forest. Hundreds gathered for a speak-out on campus.

One of Soares’s classes this spring documented the 1860 sale of a group of enslaved people by the university’s treasurer to benefit Wake Forest, and the sociology department organized a commemorative event on campus in May.

Dean Franco, an English professor who has been at the university for about 18 years, said every year it seems there’s a racist incident or discovery of something unsavory from the past. “Last year was the first time that students so strongly reacted and so strongly held the administration accountable,” he said.

It felt like a turning point, Franco said.

In July, Hatch announced efforts to acknowledge the full complexity of the school’s history and combat past and present inequities, including a presidential commission on race, equity and community, further research on institutional ties to slavery and an examination of how the university responds to bias incidents.

Hatch and other school leaders wrote a message to campus earlier this month about the emails, which they described as “steeped in the vitriol of white supremacy and nationalism."

“These emails have hurt, scared, threatened, angered, and confused many on our campus in different ways,” they wrote. “While none of the emails contained actionable threats or detailed a specific attack on our campus, they still managed to elicit the fear the sender intended.”

University officials consulted with law enforcement and threat-assessment experts, including the FBI, before deciding to continue classes and normal operations, they wrote, but there is an increased police presence on campus while the investigation continues.

The message closed with resources to support people affected, and a plea: “Please continue to look out for each other.”

An earlier version of this story incorrectly described Mir Yarfitz as an assistant professor of history. Yarfitz is an associate professor.