A man in blue hospital scrubs touched students and shouted at a classroom full of people he’d managed to sit in for at least 20 minutes after sneaking past security at 6 E. 16th St. in late February, according to witnesses and officials.

The man, who’s bald and identified himself only as “Joshua,” claimed he was applying to The New School for photography and was there for an orientation when he sat in on the seventh-floor class that began about 10 a.m. on Feb. 27, according to two students who were in the room at the time, but asked not to be named.

Almost immediately, those in the room thought he didn’t belong.

“His clothing was just suspicious to begin with,” said an 18-year-old man who was in the room. “We were aware he didn’t belong when the professor asked him to introduce himself and he started saying all of this nonsense,” the student said.

The man began saying strange things like, “I worship Satan, but not by choice” and “I lived in LA to work for a magazine,” a student said.

“It was odd. He rambled and rambled. We started to get nervous and suspicious when our teacher cut him off [and] he kept talking,” a 20-year-old woman who was in the class said.

After about 20 minutes, the professor, who declined to comment for this story, left the room to call Campus Safety, witnesses said. A young man in the class also left, followed shortly by the intruder, witnesses said.

Upon re-entering the classroom, the professor moved the man’s belongings, two plastic bags, to the front of the room, according to the 18-year-old student.

The man only re-entered when Campus Safety arrived and they grabbed his things, witnesses said.

The man went to the back of the classroom to the desk he was sitting in. “Even though his stuff was in the front of the room, [he was] pretty much wasting time,” the 18-year-old student said.

He then touched one man’s legs, according to the 20-year-old woman.

“Don’t touch people,” security told the man, witnesses said.

He then touched a girl’s shoulder, kicked a trash can before shouting at the professor, “You ruined your class you f—ing c–t,” according to a witness.

“[Campus Safety] just stood at the door basically, waited for the guy to get his stuff,” the 18-year-old student said.

He was then escorted out by security, school officials said.

The man then tried to re-enter the building about 10:25 a.m., according to Alandria Moore, a sophomore studying literary studies who was standing outside of the building with a friend at the time.

“He came and tried to get into the building, like he walked in, he said, ‘Hey’ to us,” Moore said.

“One guard came from the exit from the elevators and then one [guard] came from the [entrance] you use to regularly get in,” Moore added.

“Yeah, that’s the guy,” a security guard said, according to Moore.

Back upstairs, a Campus Safety official told the class that they’d post a photo of him at the front desk so guards can be on the lookout.

“His picture has been circulated to Campus Safety personnel, and he has been barred from our facilities,” Director of Campus Safety Thomas Illiceto wrote in a university-wide email.

“Please notify Security if someone has improperly entered a building without proper identification,” the director added.

It is unclear how the man got past campus security, but officials are still looking into it.

“Campus Safety is aware of the incident and is actively investigating the matter,” said university spokeswoman Amy Malsin.

It was not immediately clear if the police were called. An NYPD spokeswoman did not have any information about the incident as of Wednesday Feb. 28.

Those in the classroom were rattled by the intrusion that called to mind the deadly Valentine’s Day shooting in Parkland, Florida, in which a gunman walked onto a high school campus and fatally shot 17 people and wounded 14 more.

“We were all shaken up and scared, and the precautions [taken] were not satisfying. In light of recent events (Florida) it’s [scary] that we are so lenient in our security,” the 20-year-old witness wrote to the Free Press.

“I always prided myself of going to a school with tons of security, where you had to sign people in,” she added. “This isn’t an open campus, you can’t just walk in. And yet, someone did.”

This is a developing story.

Photo by Orlando Mendiola