An irate Manhattan judge ​on Wednesday ​​threw the book at the abusive jerk who forced the mother of his child to walk naked through the winter streets of Harlem ​for texting other men ​—​ ​lambasting hi​m for a medieval interpretation of gender roles.

“Jasson Melo’s views of women belong to the Dark Ages,” Manhattan Criminal Court Justice Robert Mandelbaum ​chastised the creep before tossing him in prison for 2 1/3 to 7 years​.​ “To him, women are property, whose role is to obey.”

Melo was convicted last month of various counts of coercion, assault, menacing, aggravated harassment and endangering the welfare of a child for the Jan​uary 2016 incident.

Ever oblivious, Melo walked into court Wednesday throwing winks at relatives in the gallery. When asked if he wanted to speak, he halfheartedly mumbled something about being found “guilty.”

The 26-year-old forced the mother of his 2½-month-old daughter into the frigid streets, wearing only a towel and leaving the baby behind alone, after he found pictures of another man’s penis on her phone, jurors found. During testimony, the woman, whose name is being withheld, said she and Melo had broken up. He claimed they were still together.

The 24-year-old, who moved to Florida and changed her appearance after the video went viral, testified that Melo threatened to push her down the stairs or bash her with a Buddha statue if she didn’t agree to go outside naked to atone for the texts.

But once outside, Melo started filming, and then grabbed the towel off her body​ ​—​ ​leaving her stark naked in the middle of the residential street.

“Although Mr. Melo might not have intended for the ​video ​to go viral, he was eager to reap the benefits of it having done so,” the ju​dge said with disgust, citing the former United Nations chef’s attempts to hawk T-shirts and hats from the footage bearing his “catchphrases.”

“You wanna be a tot? Be a tot” read one T-shirt, selling for $20. Melo appeared to have confused the derogatory phrase “THOT” for tot, and even thickly explained on the stand that he’d lovingly meant “potato tot,” not the more widely recognized acronym for “that hoe over there.”

Despite being canned from the UN following his arrest, the self-proclaimed “Most Famous Cuckhold” bizarrely wore his expired UN credentials on a lanyard around his neck for most of the trial.

Melo’s ex was not in court, but prosecutor Caitlin Connolly read a statement on her behalf before Maundelbaum signed a permanent order of protection, barring Melo from seeing or contacting the woman or their shared daughter ever again.

“My days are consumed with embarrassment, fear and paranoia for my daughter and I,” Connolly read. “Mr. Melo destroyed me in so many ways, and didn’t stop as he would continuously taunt me as if my nightmare was his sick joke.”

“These past two years have been consumed with countless sleepless nights, waking up crying, terrified and reliving the events over and over again,” the victim wrote. “I used to ask myself ‘when will this emotional turmoil end?’ That question remains.”

During the seven-day trial, jurors heard that Melo arrived home around 5​ ​a.m. to find the mother of his child in bed, texting. He claimed he later heard her exclaim “Oh, how big,” while in another room, and rushed in to discover a snap of another man’s member in her texts.

Melo’s lawyer, Theodore Herlich, quipped during closing arguments that his client suffered from “penis envy” and lost his mind with rage upon discovering the penis pic.

Herlich on Wednesday said he intends to appeal.

“In this egregious case of domestic violence, Jasson Melo repeatedly assaulted the mother of his two-month-old child, forced her to walk outside in January naked, filmed his act of utter humiliation, and then disseminated it in a manner that caused it to go viral,” District Attorney Cy Vance said in a statement.