New York (CNN) -- The conviction of a former New York police officer for conspiring to kidnap, torture, cook and eat women has been overturned by a federal judge, who ruled that the evidence against him amounted to "fantasy role-play."
Gilberto Valle, who has already served 21 months in jail and faced life in prison on the kidnap conspiracy conviction, did not say a word when he appeared in a federal courtroom Tuesday. He smiled and waved at relatives in court. One woman, in tears, said before the hearing, "He's coming home today."
Prosecutors said they will appeal the decision, and bail for Valle was set at $100,000. He could be released as early as Tuesday.
Defense attorney Julia Gatto said the decision backed up her assertion that Valle is "guilty of nothing more than very unconventional thoughts ... We don't put people in jail for their thoughts. We are not the thought police and the court system is not the deputy of the thought police."
"Gil Valle has been in jail for almost 21 months, seven months of that were in the indescribable hell that is solitary confinement, all for a crime that he didn't commit," she said.
Valle was ordered to undergo a mental health evaluation, and to surrender travel documents and weapons. U.S. District Court Judge Paul Gardephe also ordered GPS home monitoring for the defendant.
"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 said in the 118-page opinion released Monday night.
Valle's lawyers argued at his trial last year that the former police officer's e-mails and online postings were just that -- "fantasy role-play" and "dark improv theater." But prosecutors said he was "deadly serious."
In his decision, Gardephe ruled that "once the lies and the fantastical elements are stripped away, what is left are deeply disturbing misogynistic chats and emails written by an individual obsessed with imagining women he knows suffering horrific sex-related pain, terror and degradation."
"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," he added.
The trial evidence provided by prosecutors was not "sufficient to demonstrate beyond a reasonable doubt that Valle entered into a genuine agreement to kidnap a woman, or that he specifically intended to commit a kidnapping."
Valle also was found guilty of illegally accessing a federal law enforcement database.
The database, which Valle was trained to use and had access to as a police officer, helped him research potential victims, prosecutors said.
No one was kidnapped, but the jury did see what prosecutors said were detailed plans to carry out a plot.
Valle, a six-year NYPD veteran, was convicted after prosecutors presented evidence such as a document found on his wife's laptop titled "Abducting and Cooking Kimberly -- A Blueprint." The same document listed "materials needed," which included a gag, rope, chloroform and a tarp for the trunk. The FBI never found any of these items in Valle's possession.
According to trial evidence, he communicated online with three co-conspirators on the Dark Fetish Network, prosecutors said.
At trial, Gatto called Valle's conduct "pure fiction" and "make-believe."
"He is anxious to get home to his family, the people who supported him through this whole ordeal," she said of her client on Tuesday. "I am sure he is very relieved, very tired. Prison has been hard... He has to pick up the pieces of his life."
CNN's Haimy Assefa and Julia Talanova contributed to this report.