In a stunning reversal, the conviction of so-called “Cannibal Cop” Gilberto Valle in a bizarre plot to cook, rape, kill and eat women was overturned by a federal judge late Monday after he ruled there was insufficient evidence to support it.

Manhattan Judge Paul Gardephe acquitted Valle on the charges stemming from the alleged flesh-eating fetish plot that even targeted his wife. He had faced life in prison on that count after being convicted in March 2013 but could now go free as early as Tuesday.

“The evidentiary record is such that it is more likely than not the case that all of Valle’s Internet communications about kidnapping are fantasy role-play,” Gardephe wrote in his opinion.

However, the judge upheld Valle’s conviction on a second count of illegally using the NYPD’s federal database to compile a list of female targets and information on them.

Valle, who has been in jail since being arrested in late 2012, faced up to a year in prison on that count — so he has already served his time.

The judge set a conference Tuesday to discuss the status of the case.

Valle’s mom arrived at the federal courthouse with a fresh set of cloths, presumably for the disgraced cop to wear at his hearing and/or for his potential release from jail.

Valle, 28, had yet to be sentenced because he had appealed the jury’s conviction. His lawyers claimed jurors couldn’t differentiate between Valle fantasizing about his fetishes and actually plotting to commit them.

No females were ever kidnapped or harmed in the plot.

“No one was ever kidnapped, no attempted kidnapping ever took place, and no real-world, non-Internet -based steps were ever taken to kidnap anyone,” Gardephe wrote.

“Dates for `planned’ kidnappings pass without comment, without discussion, without explanation, and with no follow-up. The only plausible explanation for the lack of comment on inquiry about allegedly agreed-upon and scheduled kidnappings is that Valle and the others engaged in these chats understood that no kidnapping would actually take place.”

The judge said he was disgusted with Valle’s “misogynistic” writings but concluded those thoughts didn’t equate to real crime.

“Once the lies and the fantastical elements are stripped away, what is left are deeply disturbed misogynistic chats and emails written by an individual obsessed with imagining women he knows suffering horrific sex-related pain, terror and degradation,” the judge wrote.

“Despite the highly disturbing nature of Valle’s deviant and depraved sexual interests, his chats and emails about these interests are not sufficient – standing alone – to make out the elements of conspiracy to commit kidnapping.”

The cop would visit the website darkfetishnet.com to meet others to map out the fiendish scheme.

Prosecutors said he planned to kidnap three women during the week of Feb. 20, 2012.

A document found on his wife Kathleen’s laptop at their Forest Hills, Queens, apartment was titled “Abducting and Cooking Kimberly — A Blueprint.”

The same document included the “materials” one would need, and included a gag, rope, chloroform and a tarp for a car trunk.

He also professed a desire to become a “professional kidnapper” and revel in the suffering of his victims as they were roasted alive.

“Obviously, the case involved thoughts that were unusual and bizarre and, frankly, very ugly, and we think that the jury just couldn’t get past that and they never got to the law,” his lawyer, Julia Gatto, said after the verdict in March 2013.

His plot was uncovered when his wife used computer spyware to uncover her hubby’s depraved online chats.

Gardephe wrote of this case: “The highly unusual facts of this case reflect the Internet age in which we live.”