As he left State Supreme Court in Manhattan with his parents, Mr. Thomsen said the police had tricked him into admitting crimes he had never committed and could not recall. “It’s all untrue,” he said.

The case had been losing steam for months, according to statements made in court by prosecutors. Social workers interviewed 13 children from the school, but could find only one who had a recollection of being touched by Mr. Thomsen in a way that could be considered inappropriate. Two other teachers in the classroom said they had seen nothing untoward.

Prosecutors also had doubts about whether Mariangela Kefalas, the teacher who reported Mr. Thomsen to the police, would be perceived as a reliable witness by a jury, a law enforcement official said, speaking on the condition of anonymity. The videos that Ms. Kefalas shot of Mr. Thomsen in the classroom did not show criminal conduct.

Before his arrest on June 27, Mr. Thomsen had been a well-liked intern at the International Preschools, where he had started working with a class of 4- and 5-year-olds in February.

After Mr. Thomsen’s arrest, his parents mortgaged their house in Denmark to pay his bail, and they have accumulated $200,000 in legal fees. Mr. Thomsen has been tethered to New York City, unable to return to his studies until prosecutors decided whether to present the case to a grand jury. “It’s been five months out of my life I will never get back,” he said.