A transgender man who used a fake penis to have sex with women — and made one feel ashamed for not getting pregnant — has been jailed.

Carlos Delacruz, 35, hoodwinked two women for years but was eventually turned in to the cops after they discovered what he had been doing.

Delacruz, who was born a woman in Madrid, Spain, appeared in August at Edinburgh Sheriff Court in Scotland, where he admitted penetrating both women with an unknown object without their consent.

Delacruz, from Banknock, Scotland, had refused to allow the women to see him naked and always performed in bed with the lights out.

Both victims, who cannot be identified for legal reasons, were said to have suffered “extreme pain” during intercourse, while both women also suffered from thrush afterward.

Delacruz was jailed for three years and handed a five-year non-harassment order against both women. He was also put on the sex offenders register.

Defense lawyer Cameron Tait said Delacruz had developed “a male appearance” at age 8 before officially changing his name to Carlos when he turned 16.

The court heard Delacruz’s gender is now officially recognized as male and his gender is stated as male on his birth certificate, passport and Spanish identity card, though he has not fully transitioned.

Tait also told the court Delacruz considers the prosthetic penis he used during sex with the women “to be part of him.”

The lawyer added Delacruz is currently in a long-term relationship with a woman and that she is fully aware and consenting to the use of the prosthetic penis he uses during sex.

The judge in Delacruz’s case told him that he had caused “physical and psychological harm” to both women by repeatedly sexually assaulting them with “a flesh and blood penis” during their relationships.

The judge said the first victim was “made to feel like it was her fault” she was not getting pregnant and that “she now suffers flashbacks and panic attacks” due to the incidents.

The judge, who read the victim impact statements, said the woman “now feels dirty and used” and that she was forced to move to get away from him.

The second victim was said to have “bled for days” after having sex with Delacruz around 10 times over an eight-month period and currently suffers from “difficulty with sleeping and eating.”

Prosecutor Kirsten Cockburn told the court that Delacruz had been in a relationship with both women at separate times between May 27, 2013, and May 14, 2017.

The prosecutor added that Delacruz and the woman would have sex around once a month despite her suffering “extreme pain” and only being allowed to touch his body “over his clothing.”

“During their relationship, the woman continued to believe he had a penis,” the prosecutor added.

The prosecutor told the court the woman suffered from thrush following lovemaking sessions with Delacruz.

The couple split up in January 2016 and the woman informed the police in May that year Delacruz had been lying to her and did not have a penis.

Delacruz began a second relationship with another woman in August 2016, and after two months of dating, they moved in together.

The second victim also “believed Delacruz had a penis” and the couple always had the lights off during sex.

The relationship failed in May 2017 due to “financial matters” the couple were having and the court was told the woman discovered Delacruz’s sordid secret the following month.

Cockburn said Delacruz made no comment in a police interview and that he was medically examined while in custody, where it was “found he did not have a penis.”