A judge ruled Wednesday that the case against a New Jersey man who allegedly confessed to killing Etan Patz — the 6-year-old boy whose disappearance became the city’s most notorious missing-child mystery– can move forward to trial.

Manhattan Supreme Court Judge Maxwell Wiley ruled on a motion filed last month by the lawyer of Pedro Hernandez, 52 years old, seeking to dismiss the murder indictment. Judge Wiley found that there was sufficient evidence put before the grand jury to sustain the charges and allowed the case to move forward.

Mr. Hernandez, dressed in a tan prison outfit, stared straight ahead during the hearing, not showing any emotion or looking back at the audience.

His attorney, Harvey Fishbein, had filed the motion to dismiss last month based on the grounds that the evidence put before the grand jury consisted entirely of Mr. Hernandez’s confession, which Mr. Fishbein said was false.

After the hearing Wednesday, Mr. Fishbein said the judge’s decision wasn’t “totally unexpected” but added “that does not mean we still don’t believe the district attorney’s office should have brought this case in the first place.”

Etan, a 3-foot, 4-inch first-grader, disappeared on May 25, 1979, while walking alone from his parents’ home in SoHo to a school bus stop several blocks away. The case drew national attention after Etan became one of the first children whose picture was featured on milk cartons.

A year ago, New York Police Department detectives were tipped off by one of Mr. Hernandez’s family members that he had spoken in the past about having abducted and killed a young boy years ago in Manhattan. At the time, Etan’s name had reappeared in the news since investigators were digging in a basement of a building near the Patz’s home after receiving a tip about another possible suspect that didn’t pan out.

After being questioned for several hours by NYPD detectives, Mr. Hernandez allegedly confessed to luring the boy off the street, authorities said, with an offer of a free soda and into the basement of a deli where Mr. Hernandez, then 18 years old, worked part-time. According to authorities, Mr. Hernandez allegedly told investigators that he strangled the boy, placed his body in garbage bags and later dropped the bag in a pile of trash several blocks away. Etan was never found.

Mr. Fishbein has said that Mr. Hernandez has a long history of mental illness, including schizophrenia and bipolar disorder, and contends that the confession was false.

He said Wednesday that he will present evidence of Mr. Hernandez’s psychiatric history at the trial, which still hasn’t been scheduled. But the attorney emphasized he is not relying on a psychiatric defense at trial.

“This isn’t a technicality defense,” he said. “This is ‘I did not do it.’ It’s a false confession.”

Mr. Fishbein’s motion last month cited relevant law stating that a “person may not be convicted of any offense solely upon evidence of a confession or admission made by him without additional proof that the offense charged has been committed.”

Mr. Fishbein contended in his court papers that there was no evidence presented to the grand jury corroborating the confession and that repeating statements to law enforcement officers, friends and family members does not by itself corroborate it.

“The People (prosecutors) cannot bootstrap one statement to another and call it sufficient evidence,” the motion states.

In his ruling, Judge Wiley appeared to contradict Mr. Fishbein’s interpretation of the law, saying the law does not mandate independent evidence to corroborate every component of the crime charged.

Mr. Fishbein also argued in his April motion that Mr. Hernandez’s confession should be suppressed because it was the result of an “unlawful arrest.” Mr. Hernandez was not read his Miranda rights at the time of his arrest and subsequently made his confession, the motion states. Only then did detectives read Mr. Hernandez his Miranda rights and have him repeat his statements. The result, the motion argues, was that Mr. Hernandez made the statement without knowingly waiving his right to remain silent and his right to obtain a lawyer.

Earlier this month, prosecutor Joan Illuzzi-Orbon filed the Manhattan District Attorney’s response to Mr. Hernandez’s motion to dismiss, saying that the fact that Etan’s body was never found does not preclude prosecutors “from going forward and proving that Etan Patz’s death was caused by the defendant.”

In her response motion, Ms. Illuzzi-Orbon did not address Mr. Fishbein’s “unlawful arrest” claims. The judge’s ruling on Wednesday also did not address those claims. Mr. Fishbein said they will addressed at a future hearing.