A New Orleans cop serving life in prison after he was convicted of raping a seven-year-old girl last year had his conviction overturned Wednesday over texts he was sending to his girlfriend during the trial.

Michael Thomassie, 42, was sending texts to his girlfriend about how he would like her to shave her pubic hair.

The texts were then introduced as evidence to argue that he would be inclined to rape a prepubescent girl  because he preferred no pubic hair.

An appeals court reversed the conviction on the basis that there is no evidence that proves men who prefer adult woman to shave their genital area tend to be pedophiles.

The 4th Circuit stated in its opinion that the judge should never have allowed the texts to be entered as evidence because they “constitute irrelevant, prejudicial appeals to emotion and inflammatory arguments going before the facts of the case,” according to The Times-Picayune. 

The victim in the trial was 19 years old when she testified against him last year, telling the jury that he raped her in 2003 at the age of seven when he was her mother’s live-in boyfriend – who is not the woman he was texting during the trial.

But she did not report the rape until 2013 because her substance-abusing mother was financially dependent on the cop, prosecutors argued.

Also, the 12-year-old son of the cop and the girl’s mother testified on his behalf, claiming that his mother had testified to walking in on the cop raping her daughter to obtain custody of him after his father was sent to prison.

But it was the introduction of the texts that led to the reversal.

During the August 2015 trial, Thomassie sent selfies to his girlfriend while having a raunchy text conversation, apparently not at all concerned that his life was on the line.

“No hair is best but as long as you’re clean, I’m good,” he said in one exchange.

And prosecutors seized on that text with the help of the judge to convince the jury of his guilt.

According to The Advocate:

Assistant District Attorney Laura Cannizzaro Rodrigue persuaded Criminal District Court Judge Tracey Flemings-Davillier to allow the texts as evidence in the case. Rodrigue argued that the texts were “essentially evidence of guilt” for a man “who is inclined to rape a child.”

Flemings-Davillier agreed, and Rodrigue highlighted the text exchange in her closing argument before the jury began deliberating the case.

“If this were a murder, I’d say it’s not relevant, but this is a man charged with raping a prepubescent girl, a 7-year-old girl, and he’s taking selfies, telling his girlfriend he prefers women with no pubic hair,” Rodrigue told the jury. “That should be very alarming to any person sitting on this jury. That should be one of the most important things to give you an idea of just what kind of real good guy he is.”

It wasn’t even a unanimous conviction with 10 of the 12 jurors voting to convict, which would have led to a mistrial in federal court but not in certain state courts.

Prosecutors vow to seek a review of the appellate decision from the Louisiana State Supreme Court.

It is not clear if he will be released before a new trial is set.