NEW YORK (CBSNewYork/AP) — A former New York Police Department officer was released from jail on Tuesday after a judge overturned his conviction in a bizarre case accusing him of plotting to kidnap, kill and eat young women.

Judge Paul Gardephe ruled late Monday that there was insufficient evidence to support a jury’s guilty verdict in the kidnapping conspiracy conviction of Gilberto Valle. His lawyers had argued that the alleged plots were really fantasy online role play that never put anyone in harm’s way.

Conviction In 'Cannibal Cop' Case Overturned

He offered a public apology outside court “to anyone who was hurt, shocked or offended by my infantile actions.”

The ex-cop squeezed his mother’s hand as he felt the sunlight after being locked up for nearly two years. He went on to thank his prison guards and fellow inmates for looking after and protecting him while he was behind bars, CBS 2’s Matt Kozar reported.

“Thy made this impossible situation more tolerable for me. I’ll never forget them. I love them,” he said.

Valle — dubbed by the tabloids as the “Cannibal Cop” — smiled at his family and hugged his lawyers in court on Tuesday. The judge set bail at $100,000 and ordered home detention for the defendant after prosecutors told him they intended to appeal his ruling.

“The government believes the jury got it right,” said Assistant U.S. Attorney Hadassa Waxman.