The Columbia University student accused of raping “mattress girl” Emma Sulkowicz lost his second attempt at suing the university for discrimination — and this time the judge told him not to come back.

On Friday, Manhattan federal judge Gregory Woods tossed Paul Nungesser’s latest lawsuit, which seeks to hold the Ivy League school responsible for the backlash and humiliation he suffered from Sulkowicz’s very public rape allegations.

Judge Woods said Nungesser could not prove he was harassed based on his gender and tossed the lawsuit “with prejudice” — meaning that Nungesser is forbidden from trying a third time.

To win, Nungesser would have had to prove that Columbia knew he was being harassed based on his gender, Judge Woods said in 46-page opinion. But Nungesser himself argued in his lawsuit that “Sulkowicz’s conduct was motivated by her anger at his rejection of her as well as her anger at his having been found ‘not responsible'” for the rape, Judge Woods said.

After Sulkowicz accused Nungesser of rape in 2013, the university found the German national not responsible and dismissed the charges.

Sulkowicz responded to the school’s decision by making her allegations public and also by carrying a mattress around campus — including to her 2015 graduation.

Nungesser said Sulkowicz’s mattress act ruined his college experience and tainted his reputation. He sued Columbia under Title IX, which prohibits schools receiving federal funding from discriminating based on sex.

Despite the judge’s order to move on, Nungesser’s lawyer said his client intends to keep fighting.

“I’ve scanned the opinion and my view is that it’s mistaken,” lawyer Philip Arwood Byler said.

“We think we have a good appeal. We’re going to have to go to to the Second Circuit (Court of Appeals) and get it done right.”