What should have been a fun performance capping off Purdue University’s freshman orientation took a dark turn after comedian Andy Gross goaded a student into touching him onstage in front of an audience of more than 5,000.

At the Saturday night show, Gross — a Los Angeles comedian whose act includes magic and ventriloquy — made a female student touch his thigh as part of his routine, joked about his genitals and made the audience so uncomfortable that thousands of students left in protest, according to several students and video footage from the event.

He apologized Monday after increasing criticism from students and the school, saying in a statement through his lawyer that he was “profoundly sorry that students” at the Indiana school “were offended” by his performance.

The statement also said the comedian would not perform on college campuses in the future and would change the parts of his show that “upset Purdue’s students.”

School officials had denounced Gross amid calls for a boycott.

Some portions of the performance were clearly inappropriate and contrary to the university’s values of respect and support for all,” the school said in a statement. “We will not work with this comedian again and are proud of our students who are standing up and voicing their concerns about the performance.”

It all started when Gross singled out a female student — a supervisor with Boiler Gold Rush, the group running the orientation — to volunteer for a trick during the show, according to several students present at the performance. Gross asked her to raise her hand, then thanked her for volunteering and pulled her onto the stage.

While doing a card trick, Gross repeatedly asked the girl to come closer to him. As they stood back to back, Gross joked about being “cheek to cheek” and “feeling her vibrations,” Ryan Grunsten, a Purdue freshman who was in the audience, told The Washington Post.

“He made her stand closer and closer to him and made a joke about that giving him an erection and making his pants seem to say ‘Let me out,’ referring to his genitals,” said another student, Andora Fess, according to the Indianapolis Star.

Then Gross asked the girl to touch his thigh. From the display screens that showed a close-up of the performance, multiple students said the girl looked like she was on the brink of tears and touched Gross as little as possible, despite his nagging.

As Gross flubbed a guess-the-card trick, he quipped: “Well, I got a free feel out of it.”

The student is seen in video footage standing silently, staring at the floor.

Then she left the stage and began to sob, according to Cara Pietrangelo, a junior and a BGR supervisor. Other students rushed to comfort her.

“She felt like she was kind of abused,” Pietrangelo told The Post. “She was harassed sexually and put in a situation in front of people where she didn’t know what to do.”

In a statement to The Post, Gross’s lawyer, Rebecca N. Kaufman, said that the comedian had “performed all segments of last weekend’s act for many years without complaint” and had “never before been accused of sexual misconduct or harassment.”

“Andy was oblivious and naive about the current environment on college campuses, and he sincerely regrets causing any offense or discomfort to any student participating,” the statement says.

After the show, students took to Twitter to slam Gross — hashtag #AndyGrossIsGross — and to call for Jimmy Fallon to keep the comedian off “The Tonight Show.”

The card trick was just the beginning. Witnesses said things got even more disturbing as the act progressed.

Gross singled out another female student and chided her when she refused to come onstage. After a trick involving a dove, he flipped off the audience, saying, “I got another bird for you,” according to students who saw the performance.

Later, Gross had a male student sit on his lap and pretend to be a puppet as part of a ventriloquist act.

Before the performance was halfway through, most of the audience had walked out. Freshmen streamed out of the auditorium and onto the lawn, where they shared embraces. In GroupMe messages, they tried to process what had happened.

Numerous students were distressed and crying, according to Marisabel Segovia, another BGR supervisor.

“We had witnessed firsthand a sexual assault; that’s not something that’s easy to see,” Segovia said. “We were wiping our tears and then going ahead and helping students. We didn’t want them to have to go through this right before class starts.”

Gross’s behavior was even more jarring because of what preceded it.

Before he took the stage, a student had shared her story of campus sexual assault.

Grunsten, one of the freshmen who tweeted about the ugliness of Gross’s performance, said he was comforted by the campus community’s response.

“It’s disgusting that it happened at all, but I guess you could see some silver lining in how the community reacted to it,” Grunsten said. “People did bounce back from this.”

More reading:

A jury convicted a doctor of raping a patient at a hospital — and sentenced him to probation

‘We didn’t let girls do it in the old days,’ a judge said. ‘Inappropriate,’ a higher court ruled.

Jury convicts man for sexually assaulting a woman on a plane as his wife sat next to him