​What a d–k.

​The creep who ​forced the mother of his child ​to ​walk naked through the streets of Harlem after he caught her texting other men ​– and then filmed and posted it to social media — ​merely suffers from “penis envy,” his lawyer ​claimed in closing arguments Thursday.

“Freud was wrong that only females have penis envy, I submit my client did as well,” defense attorney Theodore Herlich said of Jason Melo, who prosecutor Caitlin Connolly painted as a “small” man who couldn’t handle the discovery of a photo of another man’s phallus in his ex’s texts.

Melo, whose fate is now in the hands of a jury, faces up to seven years behind bars if convicted on charges of coercion, menacing and harassment for the Jan. 2016 incident.

The victim, whose name is being withheld, claims that she and Melo had broken up when he found the suggestive snap and went ballistic.

The 24-year-old, who shares a daughter with the former United Nations cook, told jurors that he punched her, choked her and threatened to hit her with a statue and push her down the stairs if she didn’t agree to walk naked through the street.

Despite being canned from the kitchen job following his arrest, Melo inexplicably wore his UN credentials on a lanyard around his neck throughout the trial. The lanyard was noticeably absent Thursday.

The footage, which was later uploaded to the internet, depicts Melo telling the near-naked woman to “pay the price for [her] shame” before he jerks away the towel she’d been clutching to her body, leaving her naked on the public sidewalk.

Their 2​​-month-old daughter was left alone in the apartment, unattended, during the incident.

Herlich Thursday walked the panel through his client’s abusive comments​ ​–​ ​including messages in which Melo told the victim’s relative “If I had been someone else, I would have killed her”​ ​–​ ​saying “it could just be puffery.”

The lawyer also characterized the Florida woman as “a player,” who was “keeping all of her options open” by texting 17 men while she freeloaded at Melo’s apartment.

“Who are you for me to kill you, you don’t even have a job or benefits for me to kill you,” Melo said in one message.

Meanwhile, Connolly tore into Melo’s arrogance and fragile ego in her closings, reminding jurors how “indignant and self-righteous” the 26-year-old had been during his testimony, and how he’d “expressed no remorse.”

“This is an obsessive, paranoid, controlling person, who had every reason to hurt [her],” Connolly said. “He was smirking throughout and smiling often [during his testimony],” she told jurors.

“He was fearful and embarassed, and so driven by his insecurity,” the prosecutor told the rapt panel. “He berated her and humiliated her to punish her for making him feel so small, because he thinks it makes him look strong to dominate the mother of his child.”

“He choked her. He threatened her repeatedly. He berated her for hours. But that wasn’t enough, he wanted to shame her in front of all the world,” Connolly bellowed. “That degradation haunts her to this day.”

Melo claims he and the woman were still together, and that he lashed out upon discovering her infidelity.