The University of Southern California is suing two YouTube performers who the school says created panic after barging into classrooms to film prank videos for their channels.

Court documents obtained by the Los Angeles Times claim the pair caused “terror and disruption” during three “classroom takeover incidents” in the university’s Mark Taper Hall of Humanities.

The YouTubers, Ernest Kanevsky and Yuguo Bai, are not USC students.

A judge on Friday issued a temporary restraining order banning the pair from USC’s campus.

In the latest incident, on March 29, Kanevsky and Bai interrupted a Jewish studies lecture on the Holocaust while pretending to be “a member of the Russian Mafia” and Hugo Boss, a known manufacturer of Nazi uniforms during World War II, according to court documents.

Students ran from the classroom — in some cases tripping over seats and leaving behind laptops and backpacks — in an attempt to flee “what reasonably appeared to them as a credible threat of imminent classroom violence,” the court filing says.

One student who was in the class during the prank told KTLA she saw one of the men reach for his pocket and she “assumed” he had a gun.

Another student said the incident at USC raises questions about security on campus.

The university’s lawyers said the pair’s conduct “amounts to both a public and private nuisance” that caused students to experience fear and emotional distress.

In September, Kanevsky, Bai and an associate entered a data science lecture and allegedly used physical intimidation to force the professor out of the classroom before taking over the lectern and subjecting the students to “insults and demeaning behavior,” court documents say.

In addition to the restraining order, the suit seeks unspecified compensatory damages, along with attorneys’ fees and other related costs.

Kanevsy’s YouTube channel has more than 111,000 subscribers and his videos have received more than 8.3 million views. The channel features prank videos at universities, in gyms and restaurants, on the beach and in other locations.

He told KTLA he did not know the March 29 lecture was during a Jewish studies course and said he did not mean to offend, as he is Jewish. He added that his main goal is to “make entertaining content and to make people laugh.”

Kanevsy indicated he would not have done the prank if he knew it would have gotten this kind of reaction.